How to Validate email address in Javascript?

by THavamani 2013-08-09 18:32:23

Validate email address
Using Regular Expressions is probably the best way.

function validateEmail(email) {
var re = /^(([^<>()[]\.,;:s@"]+(.[^<>()[]\.,;:s@"]+)*)|(
".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA
-Z-0-9]+.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
1229
like
0
dislike
0
mail
flag

You must LOGIN to add comments