Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed1.swip.net!newsfeed2.funet.fi!newsfeeds.funet.fi!feeder1.news.elisa.fi!uutiset.elisa.fi!7564ea0f!not-for-mail From: Jukka Lahtinen Newsgroups: comp.lang.javascript Subject: Re: Check an input field type='email' has validated successfully Organization: N/A References: X-no-archive: yes Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Bu+HQFLcuVkcb5CDGmC8CZjWwuU= MIME-Version: 1.0 Content-Type: text/plain Lines: 14 Date: Fri, 11 Apr 2014 18:37:16 +0300 NNTP-Posting-Host: 91.155.88.191 X-Complaints-To: newsmaster@saunalahti.com X-Trace: uutiset.elisa.fi 1397230636 91.155.88.191 (Fri, 11 Apr 2014 18:37:16 EEST) NNTP-Posting-Date: Fri, 11 Apr 2014 18:37:16 EEST Xref: csiph.com comp.lang.javascript:23855 Denis McMahon writes: > The best easy check in javascript is probably that the email address > given contains no spaces, one and only one "@" symbol, and at least one > period on the right hand side of the "@". You can get more complex, the > more complex you get the higher the risk of rejecting a valid email I think it's also safe to check that there is at least one alphanumeric character before the @, at least one more between the @ and the last period, and at least two after the last period. Anything stricter than that will probably reject some valid addresses. -- Jukka Lahtinen