Java script function
<script language="JavaScript">
function checkdate(date1){
var validformat=/^\d{2}\/\d{2}\/\d{4} \d{2}\:\d{2}\:\d{2}$/
if(!validformat.test(date1.value)){
alert("Invalid Date");
document.form.date1.value="";
}
}
The above is working well ! but I want to restrict the month and days accordingly.
my format = mm/dd/YYYY hh:mm:ss
Month should not be more than 12 and less than 1 and same , date should not be more than 31 and less than 1;
one thing more !
02/02/2013 00:00:00 is valid date but 2/2/2013 00:00:00 showing as a invalid date.
How to control these two situations ?