Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
184
rated 0 times [  191] [ 7]  / answers: 1 / hits: 23480  / 13 Years ago, mon, january 30, 2012, 12:00:00

I want to validate BirthDate, which should be in mm/dd/yyyy format, on the client side.



I have tried it as following, but it is not working properly:



$(#btnUpdateEditCB3).click(function(event) {
var txtBirthDate = $('#<%= txtBirthDateCB3.ClientID %>').val();
var txtNickName = $('#<%= txtNickNameCB3.ClientID %>').val();
if (txtBirthDate != ) {
if (txtBirthDate.match(/^(?:(0[1-9]1[012])[/.](0[1-9][12][0-9]3[01])[/.](1920)[0-9]{2})$/)) {
alert(Please enter date in mm/dd/yyyy format);
$('#<%= txtBirthDateCB3.ClientID %>').focus();
return false;
}
}
});

More From » jquery

 Answers
5

Below links explains the same...see if it helps you.



Validate date using jquery



Validate date format using jquery


[#87735] Saturday, January 28, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ayleen

Total Points: 447
Total Questions: 88
Total Answers: 109

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
;