If the element complies than sufunction returns an empty string.Otherwise it returns a message describing the error and highlight appropriate element with yellow.
For the majority of your users, Java Script form validation will save a lot of time up front, but double-checking the data on the server remains necessary, in case the user has turned Java Script off.
Form data that typically are checked by a Java Script could be: validate Form On Submit ( ) This is a main function that calls a series of subfunctions, each of which checks a single form element for compliance.
The j Query validate plugin offers one of the the best ways of doing simple, effective email syntax validation on a web page.
27-Oct-2014: The script on this page has been updated to deal with cross-browser issues.