verN Posted April 23, 2007 Share Posted April 23, 2007 does anyome know how to validate an email adress using javascript as well as names thnaks Quote Link to comment Share on other sites More sharing options...
fenway Posted April 23, 2007 Share Posted April 23, 2007 Can't remember what all of the rules are -- usually alpha+numeric+underscore/hyphen does the trick, I'm sure the first google hit will have the "perfect" regex. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted April 23, 2007 Share Posted April 23, 2007 function checkMail(email) { var filterĀ = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (filter.test(email)) { alert('YES! Correct email address'); } else { alert('NO! Incorrect email address'); } } Quote Link to comment Share on other sites More sharing options...
fenway Posted April 23, 2007 Share Posted April 23, 2007 Don't you need at least one period in the domain? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.