Adding Form Validation to Bettergig.com

 by Tom Muck

In the book Dreamweaver UltraDev 4: The Complete Reference, we described how to build a sample site: Bettergig.com. Space didn't permit adding form field validation on every page that had an Insert or Update server behavior applied to it, but the process was described for the New_User page. The process described in that section dealt with client-side validation of form fields. Client-side validation uses JavaScript in the browser of your end user. This is usually effective in about 95% of the cases, but it isn't foolproof. Malicious users can disable JavaScript or post from their own form to your database, and cause database errors to occur.

That's where server-side validation comes in handy. UltraDev doesn't come with any server-side form validation behaviors, but we've written one that you can use for a variety of different validation types, including:

empty value
email
number
alpha-numeric
valid URL
alpha
zip code -- 5 or 9 digit
9 digit zip
filename
date
money
us money
time
SS number

We'll show you how to apply validation to the welcome_new_user page built in that site. Please note, this Server Behavior is for ASP only at this point.

Next >>>