...

View Full Version : Javascript email validator?



fireblade
06-12-2007, 11:36 AM
where can I get a better Javascript email validator??
I'll apreciate it if any one can give the code here .

abduraooft
06-12-2007, 11:47 AM
This may suit

result=checkemail(document.getElementById('email').value);
if(result)
alert('correct');
else
alert('incorrect');


function checkemail(e)
{
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
var returnval=emailfilter.test(e);
return(returnval);
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum