Otherwise a browser with Java Script disabled, or a hacker trying to compromise your site, can easily submit invalid data. The first test in the example is therefore only necessary in order to provide a different error message when the input is blank.
The purpose of a form validation script is to return a boolean value ('s to reference form fields, but that can lead to namespace conflicts and why make things more complicated than necessary.
This fixes the bug which allowed consecutive special charaters i.e. Please do test the script before you plan to use it.
previously [email protected] displayed as valid. If you find some problems in it then do let me know. This entry was posted on Monday, May 5th, 2008 at pm and is filed under Java Script.