How can I validate an email address in JavaScript?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All email addresses contain an ‘at’ (i.e. @) symbol. Test that necessary condition:
Or, if you need to support IE/older browsers:
Don’t bother with anything more complicated. Even if you could perfectly determine whether an email is RFC-syntactically valid, that wouldn’t tell you whether it belongs to the person who supplied it. That’s what really matters.
To test that, send a validation message.
This was stolen from http://codesnippets.joyent.com/posts/show/1917