Contact Form Validation The Dreamweaver Way
Over the past couple of weeks I have written two articles on Creating Contact Forms with Dreamweaver using PHP and ASP. These articles have been quite popular. The one thing that these forms lacked was form validation, meaning that visitors could enter anything into the fields they liked. This is not really what we want and leaves the door open to a ton of spam and automatic form fillers the ability to easily send us crap!
In Dreamweaver CS3 there is a very easy way to apply form field validation and in this article I will so you exactly how to achieve this.
Step 1. Create The Form or Open an Existing One
In this example I am going to use the form that I created when doing the ASP Contact Form Example.

Step 2. Apply The Validation To The Form Elements
Ok with your form now open in Dreamweaver click on the Submit Button. Now on the Top Menu Select Window > Behaviours You will now notice on the right hand side under the TAG Heading that the Behaviours Tab is now active.

Click the Plus Icon and then Select Validate Form. You will then be presented with the Validate Form Dialog Box.

Here you will find all the Fields that we can apply Validation to. For this example I went through and marked all the fields required, and also for the email text box I only want to accept and email address so I selected the Email Radio Button next to the Accept Section.
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.

There we have it, you can now apply form validation to your Contact Forms.
Don’t Miss Out on The Tips that others are getting, SIGN UP for my Web Design Tips Newsletter.
You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.



April 24th, 2008 at 6:51 am
Thanks so much… your tutorials are straight to the point and more informative than information I pay for in courses.
June 9th, 2008 at 7:01 am
your tutorial is very handy
thx man
September 6th, 2008 at 12:36 pm
This tutorial and the prior ones on forms made creating a form very easy. The only hassle I have is how to validate that one of three radio buttons have been chosen, without doing something much more complicated.
September 7th, 2008 at 6:09 am
I want to know a method that validate e-mail forms from maill server