Javascript for email validation !
function check()
{
var elem= document.getElementById("txtEmail");
var str = elem.value;
var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
if (!str.match(re))
{
alert("Verify the e-mail address format.");
}
else
{
alert("Correct!");
}
}
No comments:
Post a Comment