/**--------------------------
//* Validate Date Field script- By JavaScriptKit.com
//* For this script and 100s more, visit http://www.javascriptkit.com
//* This notice must stay intact for usage
---------------------------**/
function checkdate(input){
var validformat=/^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format validity
var returnval=false
if (!validformat.test(input.value))
alert("Invalid Date Format. Please enter two digits for the month, two digits for the day, and four digits for the year: MM/DD/YYYY.")
else{ //Detailed check for valid date ranges
var monthfield=input.value.split("/")[0]
var dayfield=input.value.split("/")[1]
var yearfield=input.value.split("/")[2]
var dayobj = new Date(yearfield, monthfield-1, dayfield)
if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))
alert("Invalid Day, Month, or Year range detected. This means that you entered a wrong month, day, or year. For example, you may have entered a month as 40. The month must be indicated only by a range of 1-12. Please correct and submit again.  Enter two digits for the month, two digits for the day, and four digits for the year: MM/DD/YYYY.")
else
returnval=true
}
if (returnval==false) input.select()
return returnval
}
