Script: var email=document.getElementById("txtEmail").value;
var emailfilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/;
var illegalchars = /[\(\)\<\>\,\;\\\\"\[\]]/;
if (!emailfilter.test(email)) {
alert("Invalid email");
document.getElementById("txtEmail").focus();
return false;
}
else if (email.match(illegalchars)) {
alert("Invalid email address");
document.getElementById("txtEmail").focus();
return false;
}
else
{
return true;
}