I have 2 text field in a form. 1st field for input date. I want to use onclick event handler for 2nd text field. When user click 2nd text field then show up the value of 10 days before the input date in 1st field. how do i do that? thanks
@CharlesOct 27.2005 — #<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Content-Script-Type" content="text/javascript"> <meta name="Content-Style-Type" content="text/css"> <title>Example</title>
<script type="text/javascript"> Date.prototype.daysBefore = function (n) { if (isNaN (this) || isNaN (n)) return NaN var d = new Date (this.getTime()) d.setDate (d.getDate() - n) return d } </script>