Narasimha p

Narasimha p

  • NA
  • 62
  • 10k

Email Address Validation @ is not working cshtml

Jun 4 2021 2:04 PM
$('#pin_Email').keypress(function (e) {
var regex = new RegExp("^([a-zA-Z0-9]+)@([a-zA-Z0-9]+)\.([a-zA-Z]{2,5})$");
var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
if (regex.test(str)) {
return true;
}
else {
e.preventDefault();
return false;
}
});

Answers (3)