Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder fireblade's Avatar
    Join Date
    May 2007
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript email validator?

    where can I get a better Javascript email validator??
    I'll apreciate it if any one can give the code here .
    Fi®e bLádê
    follow me on twitter

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    This may suit
    
    result=checkemail(document.getElementById('email').value);
    if(result)
      alert('correct');
    else
      alert('incorrect');
    
    
    function checkemail(e)
    {
    var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
    var returnval=emailfilter.test(e);
    return(returnval);
    }
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •