I wrote this function as an answer to another question, but I think it should do what you want -
function isValidDate(strDate) {
if (strDate.length != 10) return false;
var dateParts = strDate.split("/");
var date = new Date(dateParts[2], (dateParts[1] - 1), dateParts[0]);
if (date.getDate() == dateParts[0] && date.getMonth() == (dateParts[1] - 1) && date.getFullYear() == dateParts[2]) {
return true;
}
else return false;
}
Demo - http://jsfiddle.net/2r6eX/2/
To use with your code, you could do something like -
if (!isValidDate(enteredDOB)) {
$("#invalidDOB").fadeIn("slow");
return false;
}
Demo of code integrated with your code - http://jsfiddle.net/ScEuV/1/
Further solutions are given in the original question - How to check if a string is a legal "dd/mm/yyyy" date?