Hi All,
I'm trying to get my Validation to check my calendar to ensure that the date being selected from the calendar is a future date.
The code I am currently using is:
Unfortunatly it only validates the date, and not if the date captured is a future date. Ideally I would like it to check that the date selected is at least 29 days from the current date.Code:var dateString = document.form1.date.value; var myDate = new Date(dateString); var today = new Date(); if(document.forms.form1.date.value=="") { alert("Please select a date from the calendar."); document.forms.form1.date.focus(); return false; } else if (myDate<today) { alert("Please select a future date from the calendar."); document.forms.form1.date.focus(); return false; }
Thanks![]()


Reply With Quote
Bookmarks