Wednesday, May 17, 2017

function to validate email address in HTML

function email(fld)
{
with(fld)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if(apos<1||dotpos-apos<2)
{
alert("Invalid email address");
return false;
}
else
{
return true
}
}
}

No comments:

Post a Comment