<html> <head> <script language="javascript" type="text/javascript"> re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/ function submitIt(myform){ if(re.test(myform.email.value)) { return true } alert("Invalid Email Address") myform.email.focus() myform.email.select() return false } </script> </head> <body bgcolor="white"> <h2 Align="center"> email validation </h2> <form onSubmit="return submitIt(this)" action=" " > <table> <tr> <td align="right" valign="top"> Email Address: </td>
<td> <input name="email" type="text" size="50" > <p> <input type="submit" value="submit"> <input type="reset"></td> </tr> </table> </form> </body> </html>