<script type="text/javascript">

function isValideDate(datavalue){
 var regexValidDate = /^(?:(0[1-9]|1[012])[\/.](0[1-9]|[12][0-9]|3[01])[\/.](19|20)[0-9]{2})$/;
 return regexValidDate.test(datavalue);
 }

var dateToCheck = '06/01/2011',

if(isValideDate(dateToCheck)){

alert("Given date is valid as per the format of MM/dd/YYYY");

}else{

alert("Given date is not valid as per the format of MM/dd/YYYY");

}

</script>

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.