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