var userinput = $(this).val();
var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i
if (!pattern.test(userinput)) {
alert('not a valid e-mail address');
}
var pattern = /^\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i
if (!pattern.test(userinput)) {
alert('not a valid e-mail address');
}
No comments:
Post a Comment