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

when i enter the date 10-10-2010 or such type like this. it does not accept. will anybody verify it?

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.