Topic: javascript email-checker (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic: javascript email-checker (Page 1 of 1)" rel="nofollow" >Topic: javascript email-checker <span class="small">(Page 1 of 1)</span>\

Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 07-28-2007 22:29 Edit Quote

hello, i am looking for a javascript function that checks a string for a valid emailaddress. it doesnt have to be super-exact. so no TLD-checking is required.

if anyone of you guys has such a function, i would be very grateful if you would share it. thanks!

Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 07-29-2007 02:09 Edit Quote

Peter-Paul Koch's QuirksMode : JavaScript - Valid email address

Paranoid (IV) Inmate

From: Madison, Indiana
Insane since: Aug 2000

IP logged posted posted 08-01-2007 20:24 Edit Quote

Validating e-mail addresses can't be done with a simple regular expression. One of the main problems with trying to validate an e-mail address with a regular expression is that the RFC for e-mail addresses allows almost any string you can think of as a valid address and if you use an expression that looks for the pattern /[a-z]+@[a-z]+\.(com|net|org)/, you will end up telling a lot of people with valid e-mail addresses that their address is invalid.

As a quick example, I use a program called MailWasher to screen my e-mail before I get it from the server. MailWasher doesn't recognize that '+' is a valid character in an address and I'm getting more and more e-mails from mailing lists where people have decided to use '+' in their address. As a consequence, I get about five e-mails a day that MailWasher marks as being suspicious because it contains an invalid address.

Take a look at the following links for a better description than I've given of how to validate e-mail addresses:

Regexp for validating an email address
How to Validate an E-mail Address
Valid Internet Email Address.
more reading


-- not necessarily stoned... just beautiful.

Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 08-01-2007 23:30 Edit Quote

poi thanks for the link, but not even the built in example on that page works. JS errors in opera, ie and firefox.

hyperbole you are right that its quite difficult. as i said i am not looking for a super-correct checker. only thing is it should produce false negatives.

Post Reply
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
Your Text:
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu