re = /^(\d{1,2})-(\d{1,2})-(\d{4})*$/;
if((form.dob.value="") || (!re.test(form.dob.value))) {
alert("Error:enter Valid date of birth!");
form.dob.focus();
form.dob.style.background = "yellow";
return false;
}Inline Code Example Here
John_74
0
Newbie Poster
John_74
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.