I hate form generation and validation because the majority of the process is tedious and mindless.
In addition to being boring,
there is too much room for simple error,
which could render your application insecure or just plain useless.

So I wrote FormBuilder to try and get rid rid of the stoopid parts,
as well as take care of some tricky parts.
As a result,
you can build a complete application with something like this:

That simple bit of code would print out an entire form, laid out in a table. Your default database values would be filled in from the DBI hashref. It would also handle stickiness across multiple submissions correctly, and it will also be able to tell if it's been submitted. Finally, it will do both JavaScript and server-side validation too.

You simply define your fields and their values, and this module will take care of figuring out the rest. FormBuilder will automatically generate the appropriate input fields (input, select, radio, etc), even changing any JavaScript actions appropriately.

Just specify a hash of values to use as the defaults for your fields. This will be searched case-insensitively and displayed in the form. What's more, if the user enters something via the CGI that overrides a default, when you use the field() method to get the data you'll get the correct value.

Form validation sucks, and this is where FormBuilder is a big help. It has tons of builtin patterns, and will even generate gobs of JavaScript validation code for you. You can specify your own regexps as well, and FormBuilder will correctly check even multivalued inputs.

FormBuilder can natively "drive" several major templating engines, including HTML::Template, Template Toolkit, and Text::Template. if you want to build a form application with a template in less that 20 lines of Perl, FormBuilder is for you.