JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Validate an Email Address Posted by Fatalsniper on 28 Oct 2002 at 6:32 PM
Hi there,

I need to validate email addresses from a text box, if you know how to do that, I appreciate for you to tell me...

Thank you...
Report
Re: Validate an Email Address Posted by borislav on 29 Oct 2002 at 1:14 AM
Hi man,
Can you try this way (simple, byt it works)

var email_account="some@somewhere.com";
<!-- start spliting -->
var b=email_account.split('@');
b[1]=b[1].split('.');
<!-- end spliting -->
document.write(b[0]+'<br>'+b[1][0]+'<br>'+b[1][1]);

after executing the two split commands you can expect that 'b' is array
with:
b[0] is the account name in exmpl. contains 'some'
b[1] is array with servers part in example contains b[1][0]-'somewhere'; b[1][1] - 'com'
after extracting the email parts you can made every validation you want.

Report
Re: Thanks a lot Posted by Fatalsniper on 29 Oct 2002 at 12:46 PM




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.