Example of Form Validation

Here's a sample form to demonstrate form validation. Since the point of this is to see how the form handles invalid and missing input, I've set the defaults to trigger all the possible checks, so you can just hit the "Test" button to try it out. Since this is also about seeing how to repopulate a form, try filling in some values from the drop down menu and the selection box to see how they are handled. If you manage to successfully complete the form, you'll simply be returned to article Validating CGI forms with Perl. (no data is actually collected).


Some data in your form was missing or invalid. Errors are displayed below in red if they are missing or invalid.

Fields marked with an asterisk are required
Full name *:
Your pet's name:
If you have a pet, what's it's favorite food?

Your zipcode: (must be exactly 5 digits)
Favorite Color:
What kind of music do you like?
(you can select more than one option):

What are your favorite Programming Langauges (note: must contain the word "Perl"):


Valid XHTML 1.0!