function EmailValidCheck(emailtxt)
{
var email1=document.getElementById(emailtxt).value;
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
if(email1.length>0)
{
var returnval=emailfilter.test(email1);
if (returnval==false)
{
alert("Please Enter Valid Employee Email ID !!")
document.getElementById(emailtxt).focus();
return false;
}
}
}
{
var email1=document.getElementById(emailtxt).value;
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
if(email1.length>0)
{
var returnval=emailfilter.test(email1);
if (returnval==false)
{
alert("Please Enter Valid Employee Email ID !!")
document.getElementById(emailtxt).focus();
return false;
}
}
}
No comments:
Post a Comment