Script for validating online forms
Microsoft® Office Front Page® 2003 allows you to create some custom validation within the form feature.(For more information on how to create form validation using the Front Page form feature, see About creating forms in Front Page 2003.) However, if the form validation provided in Front Page does not suit your needs or the site on which you are working is hosted on a server that does not have Front Page Server Extensions from Microsoft installed, you may need to create custom form validation.The script has a catalog of almost all the common validation types built-in.The idea is to create a set of “validation descriptors” associated with each element in a form.When there are many fields in the form, the Java Script validation becomes too complex.The Java Script class presented here makes the form validations many times easier.Also, the ‘@’ must not be the first character of the email address, and the last dot must at least be one character after the ‘@’ sign. Using client side Java Script is an efficient way to validate the user input in web forms.
Now we will see how we can validate our entered form data before submitting it to the web server.
Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose.
The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
(16 printed pages) Introduction Getting Started Writing the Validation Script Connecting the Form to the Script Associating Form Fields with Custom Script Code Listing Conclusion When you create forms, providing form validation is useful to ensure that your customers enter valid and complete data.
For example, you may want to ensure that someone inserts a valid e-mail address into a text box, or perhaps you want to ensure that someone fills in certain fields.
The drop down select list boxes usually will have one item saying ‘Select One’ (and that item will be selected by default).