Design a site like this with WordPress.com
Get started

Function to validate Date of Birth using Regex

Regex to validate date of birth Solution In Jquery var checkDOB = function () { debugger; var regexp = new RegExp( '^(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\\d\\d$'); var check = $("#AddDateOfBirth").val(); if (!regexp.test(check)) { alert('Invalid Format. Please Enter: dd/mm/yyyy'); $('#AddDateOfBirth').css('border-color', 'red'); return false; } else { $('#AddDateOfBirth').css('border-color', 'green'); return true; } } In HTML @Html.TextBox("AddDateOfBirth", null, new { @class =... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑