Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > email address validation

Reply
Thread Tools

email address validation

 
 
wizard04
Guest
Posts: n/a
 
      06-26-2007
I'm trying to validate an email address field before it is submitted.
I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
sure I'm fully grasping it. As far as I understand, a convoluted
email address like andy."har<ri>\"son"@example.com would be
valid. Please correct me if I'm wrong.

 
Reply With Quote
 
 
 
 
Darko
Guest
Posts: n/a
 
      06-26-2007
On Jun 26, 5:21 pm, wizard04 <(E-Mail Removed)> wrote:
> I'm trying to validate an email address field before it is submitted.
> I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
> sure I'm fully grasping it. As far as I understand, a convoluted
> email address like andy."har<ri>\"son"@example.com would be
> valid. Please correct me if I'm wrong.


I think google search would give you a zillion links that give you
complete scripts and examples.

 
Reply With Quote
 
 
 
 
Jon Slaughter
Guest
Posts: n/a
 
      06-26-2007

"wizard04" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> I'm trying to validate an email address field before it is submitted.
> I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
> sure I'm fully grasping it. As far as I understand, a convoluted
> email address like andy."har<ri>\"son"@example.com would be
> valid. Please correct me if I'm wrong.
>



Well, you have a quoted string in there so its ok...

basically you have andy."..."@example.com

which is fine. Anything in a quoted string and it only looks odd because it
isn't really used(actually I have no idea why its used). So as far as the
lexer is concerned, thats all just one token inside the quotes and it
doesn't get parsed any farther(except possibly for quoted pairs).

In reality its not convoluted but just looks a bit strange(not sure how mail
servers handle the quoted string though).

Jon


 
Reply With Quote
 
wizard04
Guest
Posts: n/a
 
      06-26-2007
Thanks Jon

On Jun 26, 12:22 pm, "Jon Slaughter" <(E-Mail Removed)>
wrote:
> Anything in a quoted string and it only looks odd because it
> isn't really used(actually I have no idea why its used).


I don't expect anyone to actually have an address like this; I'm just
being a perfectionist.

> (not sure how mail servers handle the quoted string though).


Good question! My web host won't let me create an address with quotes,
so that says something. Probably best not to allow special characters
at all (except the .).


 
Reply With Quote
 
Jon Slaughter
Guest
Posts: n/a
 
      06-26-2007

"wizard04" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Thanks Jon
>
> On Jun 26, 12:22 pm, "Jon Slaughter" <(E-Mail Removed)>
> wrote:
>> Anything in a quoted string and it only looks odd because it
>> isn't really used(actually I have no idea why its used).

>
> I don't expect anyone to actually have an address like this; I'm just
> being a perfectionist.
>
>> (not sure how mail servers handle the quoted string though).

>
> Good question! My web host won't let me create an address with quotes,
> so that says something. Probably best not to allow special characters
> at all (except the .).
>



Yeah... you might also try some other rfc's just to be sure. The one you
gave,

RFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES

Might not be the standard for what is used for the mail protocol that we
commonly use(which I guess is smtp or whatever).



 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      06-27-2007
In comp.lang.javascript message <(E-Mail Removed)
glegroups.com>, Tue, 26 Jun 2007 15:21:51, wizard04 <(E-Mail Removed)>
posted:
>I'm trying to validate an email address field before it is submitted.
>I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
>sure I'm fully grasping it. As far as I understand, a convoluted
>email address like andy."har<ri>\"son"@example.com would be
>valid. Please correct me if I'm wrong.


Since it is impossible to determine whether an actual address is correct
- here, *0723 is currently valid, but soon it will not be - there's no
point in rigorously checking the format (unless you are an issuer of new
addresses).

The only sensible tests are whether the field has been left empty, and
whether the field might be an E-address. See
<URL:http://www.merlyn.demon.co.uk/js-valid.htm#VEmA>.

It's a good idea to write the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-English Validation Expression for email address? Mark B ASP .Net 3 07-22-2009 12:34 PM
regarding validation of email address. Vamsi Krishna Ruby 2 07-28-2008 05:12 PM
Validation on email address David, the great ASP General 6 06-18-2008 08:03 AM
My own email address as a SIP address? UK VOIP 24 01-10-2006 07:22 PM
Email Address Validation Bob Perl Misc 10 06-23-2005 08:17 AM



Advertisments