S
Scott Knapp
Good Day -
I have a form which sets the current date, as follows:
<script type="text/javascript">
xx=new Date()
dd=xx.getDate()
mm=xx.getMonth()+1
yy=xx.getYear()
mmddyy=mm+"/"+dd+"/"+yy
document.write(mmddyy)
</script>
The same form has a text box where the user is asked to input a date (a
travel date) in the format mm/dd/yyyy.
What I would like to do is compare the user input date to the current date,
and if the user input date is less than 2 days in advance of the current
date, return an alert saying that the input date is not enough in advance of
the current date.
I checked Dr. Stockton's site
(http://www.merlyn.demon.co.uk/js-date1.htm#DC) but was unable to find such
a comparison.
Any help or suggestions would be appreciated.
Scott
I have a form which sets the current date, as follows:
<script type="text/javascript">
xx=new Date()
dd=xx.getDate()
mm=xx.getMonth()+1
yy=xx.getYear()
mmddyy=mm+"/"+dd+"/"+yy
document.write(mmddyy)
</script>
The same form has a text box where the user is asked to input a date (a
travel date) in the format mm/dd/yyyy.
What I would like to do is compare the user input date to the current date,
and if the user input date is less than 2 days in advance of the current
date, return an alert saying that the input date is not enough in advance of
the current date.
I checked Dr. Stockton's site
(http://www.merlyn.demon.co.uk/js-date1.htm#DC) but was unable to find such
a comparison.
Any help or suggestions would be appreciated.
Scott