JavaScript » Forms

Form Validation

Author: Licence: Price: FREEHomepageDownloadJavaScript, FormsForm Validation

This is a simple form validation script that checks for empty fields. Dreamweaver offers very little in JavaScript form validation unless you're using Cold Fusion. In my opinion the built-in form validation behavior in Dreamweaver is sloppy and not user friendly. This script creates required fields and makes sure that the fields are not empty when the user submits the form. If the required fields are empty, the form does not submit and the focus is set to that text field. Setting the focus is a nice feature because the user is directed to the exact field that produced the error. You can do more with this script by making sure the form does not contain certain words, email address validation, and so on. For this demonstration I am only showing the basic script. Feel free to modify and utilize this script in any way you see fit. If you have any questions, contact me.

Comments on: Form Validation


FreshOne cannot be held responsible for the content of this page (Form Validation - Forms, JavaScript). The content provided on this page and the comments on Form Validation - Forms, JavaScript are user contributed.

Bookmark this page

           

Related scripts

Editing Express - Hexaconverter
Convert & Edit Exadecimal colors scale into editors triplette 0 - 255 or into registered name colors in main b...
dhtmlxGrid - Editable JavaScript Grid
dhtmlxGrid is a cross-browser JavaScript grid control designed to represent, edit and sort tabular data. Grid ...
Textarea maxlength script
This is a simple but effective script for extending your textarea with a maxlength attribute, so the user's in...
Form field Progress Bar
This useful script allows you to restrict the number of characters inside a form element (ie: textarea) while ...
Remember Form values script
Using cookies, this script remembers the value entered into your form's inputs by your visitor, and upon his/h...