Hi, I have one web application, in this i have to validate one date field of format like mm/dd/yyyy. I searched in the net but i didn't get the proper one. Please help me by providing the new function or by correcting on my code. My code is shown below.. I had called this JS function at onblur event..
function isValidDate() {
var re = new RegExp('^(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/(19|20)dd$');
if (form1.txtDateOfOccurance.value != '' && !form1.txtDateOfOccurance.value.match(re)) {
alert("Invalid date format: " + form1.txtDateOfOccurance.value);
form1.txtDateOfOccurance.value = "";
form1.txtDateOfOccurance.focus();
isEnable();
return false;
}
}
Thanks in advance..