Email Format Validation
December 4th, 2007 | posted by Anonymous
in
To Check if email is in valid form we can use this script.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Email Validation Form</title> <script> function emailValidate(strEmail) { validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; if (strEmail.search(validRegExp) == -1) { alert("Invalid e-mail address"); return false; } } </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <label> <input type="text" name="email" id="email" /> </label> <p> <label> <input type="submit" name="button" id="button" value="Submit" onclick="return emailValidate(document.form1.email.value)" /> </label> </p> </form> </body> </html>
Live Example











Post new comment