Validate date

windows

Guest
Hi<br />
How do i validate a date in a form?<br />
I have a pull down menu allowing users to select day, month and year. How do i check the date selected to ensure tat the date selected is after today's date?<br />
<br />
Pls advise<br />
<br />
tnks<!--content-->Please post the mark-up for the form that you are using.<!--content-->http://66.246.35.222/~sprint/bookings.php<!--content-->if ((new Date (document.onlineBooking.booking_year.value, document.onlineBooking.booking_month.value, document.onlineBooking.booking_day.value) - new Date()) < 0) {alert ('Please enter a date in the future'); return false};<!--content-->sorry but it doesnt work<br />
it keeps saying tat the to enter a date in the future no matter wat date i try<!--content-->Sorry about that, I deleted some important stuff while debugging. This ought to do the trick.<br />
<br />
if ((new Date (document.onlineBooking.booking_year.value, document.onlineBooking.booking_month.value, document.onlineBooking.booking_day.value).getTime() - new Date().getTime()) < 0) {alert ('Please enter a date in the future'); return false};<!--content-->sob sob<br />
still doesnt work<br />
the same problem as per the last post.<!--content-->Hihi <br />
i got it to work by making some modifications to your code already<br />
tnks a million for your help<br />
<br />
cheers<!--content-->
 
Back
Top