// JavaScript Document
//Source: http://www.codetoad.com/javascript_IsValidDate.asp

//The month needs to be a 0 (zero) for Jan, upto 11 to Dec.
//Purpose: return true if the date is valid, false otherwise
//Arguments: 	day 	integer representing day   of month
//				month 	integer representing month of year
//				year 	integer representing year

//Variables: dteDate - date object

//set up a Date object based on the day, month and year arguments
//javascript months start at 0 (0-11 instead of 1-12)

//Javascript Dates are a little too forgiving and will change the date to a reasonable guess if //it's invalid. We'll use this to our advantage by creating the date object and then comparing it //to the details we put it. If the Date object is different, then it must have been an invalid //date to start with...
<!--
function isValidDate(day,month,year)
{
var dteDate;

dteDate=new Date(year,month,day);

return ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()));
}
// -->


