ZForm HTML form management

download ZForm
User manual (incomplete)
ZForm module documentation
Sourceforge page

What is ZForm?

ZForm is a set of Perl modules that make the development of web-based forms much simpler and allow the programmer to get on with the real meat of the application.

How does ZForm Work?

When developing web applications, I find that I each form that I write needs to follow the exact same logic:

1. Display blank html form with default values
2. Validate form after submission
3. If form does not validate, redisplay form with errors. Be sure to preserve values so that the user does not need to reenter data. Go back to 1.
4. If form does validate, do something with data, and maybe go to next form.

This process is tedious and time consuming. The interesting work is in step 4, but I spend all my time on steps 1-3!

ZForm aims to make steps 1-3 easier

Step 1: Forms can be auto-generated or be defined using HTML::Template. The HTML for the input fields is always generated. This makes it easy for ZForm to maintain state between validations and also allows one to use the same exact template for a data-only view.

Step 2: Validation is a very important step. This is where we verify that the application is receiving clean data and also where the application keeps malicious users from doing nefarious things with our form. This process is almost exactly the same each time. Verify that:

Step 3: Redisplay the form if validation fails. ZForm makes things simple by turning this into step 1 with error messages.

Step 4: Perform application logic. ZForm leaves the fun to you!

Why did you write something new?

After evaluating the existing form validation perl modules, I found the following to be issues:

Who makes this possible?

My employer, ZiaNet , makes this possible. I need to develop some web-based perl applications and this library is the basis for those applications. Anthony, the owner of ZiaNet, was gracious make this project freely available.

TODO List

Valid XHTML 1.0!