I need to add to add the following characteristics to this form but I'm stuck. any help would b greatly appreciated. Thanks
- One or more word characters
- Exactly one at-sign
- One or more word characters
Exactly one period Two or more characters that are a-z, A-Z, 0-9, period, or hyphen
<!DOCTYPE html> <html> <head> <script> function validateForm() { var x=document.forms["myForm"]["email"].value; var atpos=x.indexOf("@"); var dotpos=x.lastIndexOf("."); if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { alert("Not a valid e-mail address"); return false; } } </script> </head> <body> <form name="myForm" action="demo_form.asp" onsubmit="return validateForm();" method="post"> Email: <input type="text" name="email"> <input type="submit" value="Submit"> </form> </body>