www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-21-2009, 09:23 PM
    semiNoob0820 semiNoob0820 is offline
    Registered User
     
    Join Date: Feb 2009
    Location: Chicago
    Posts: 24
    opinionS needed on email validation...

    Hello again...

    I need some EXPERT opinions on email validation (client-side). I know if someone has javascript disabled they can bypass any sort of javscript validation so I am planning to do some real hardcore email checking server-side too. However, I was curious what GOOD developers do when checking email addresses. I was using the email check that the W3schools provides.

    http://www.w3schools.com/js/js_form_validation.asp
    (look at email validation section)

    If you don't feel like going to the email part at the page let me briefly describe what it checks for in email address: "must contain at least an @ sign and a dot (.). Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign."

    This should be enough right (since I will be doing more thorough checking using PHP once submitted)? If you think I need a better client-side email validation can you please provide link or code that I can look at. Thanks!
    Reply With Quote
      #2  
    Old 11-21-2009, 09:52 PM
    crh3675's Avatar
    crh3675 crh3675 is offline
    Web Demystifier
     
    Join Date: Jan 2004
    Location: Washington DC
    Posts: 1,103
    If you are doing server side as well, not sure your question is even relevant. But, to answer your question, look for a good regexp to test the email. I use this one:

    Code:
    /^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i
    __________________
    Bittersweet web development.
    Reply With Quote
      #3  
    Old 11-22-2009, 11:34 AM
    semiNoob0820 semiNoob0820 is offline
    Registered User
     
    Join Date: Feb 2009
    Location: Chicago
    Posts: 24
    i try to implement best techniques as early as possible... and since i was reading that javascript validation should be done (even in the presence of PHP validation) for ease of use on the user so it doesn't direct away from page on every little form error... i figured i should put that into practice...

    in the future i plan to implement ALWAYS BOTH JS AND PHP validation... i guess for ease of use on the site visitors (JS)... and for the REAL check (PHP)... thanks!!!
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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 Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:34 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.