Monday 28 January 2013

How to Create Contact Form Validation in Dreamweaver

First Create the form with your required fields.
When your form will be ready then go on Window Menu and select Behaviors from there. A window will be appear on your side panel there will be some other tabs like "Attributes", "Tags" and "Behaviors". Now select the Submit Button and click on "+" sign under the Behaviors tab. A window of behaviors will be open and you will find different behaviours which you can use for different tasks. Select "Validate Form" now.

Select required validations for fields
This dialog will be open when you will select Validate Form behavior. Here you will see all text fields which you have used in contact form. Now select one by one field for validation and apply checks from under the "Fields" area. Here you will find following checks.

Value Required: Check this if you want user must enter this field
Accept: Here you will see different radio buttons with captions
  1 . Anything: User can enter anything.
  2 . Number: Only numbers will be entering.
  3 . Email address: This check will be for email validation
  4 . Number from: You can specify range of numbers.
After you have applied the Validation that you require, Save the Document and test it by not entering in anything into the fields. You should get a pop up box like this.


No comments:

Post a Comment