Js6.html

<html> <title>Email Validation</title> <script type="text/javascript"> function validateEmail() { if (document.myForm.Email.value == "") { alert("Enter a Email"); document.myForm.name.focus(); return false; } var emailID = document.myForm.Email.value; atpos = emailID.indexOf("@"); dotpos = emailID.lastIndexOf("."); if (atpos < 1 || ( dotpos - atpos < 2 )) { alert("Please enter correct email ID") document.myForm.EMail.focus() ; return false; } return( true ); } </script> <body> <form name="myForm"> Enter Email-id<input type=text name="Email"> <input type="Submit" onclick="validateEmail();"> </form> </body> </html>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.