Try testing the following form with valid and invalid email addresses. The code uses javascript to match the users input with a regular expression. 函数代码:
You should not rely purely on client side validation on your website / web application, if the user has javascript disabled this will not work. Always validate on the server. from: http://www.white-hat-web-design.co.uk/blog/javascript-validation/