Perl Form Builder ::Features ::Download ::Tutorial ::Examples
::Documentation ::FormBuilder Google Group ::Old List Archives ::Contribute
Note: The mailing list is has been replaced by the Google FormBuilder Group


1. Intro to FormBuilder
2. A Simple Form
3. Form Method
4. Input Validation
5. Field Options
6. Multi-Select Lists
7. Field Data
8. Field Attributes
9. HTML Formatting
10. Custom Headers
S. Summary


1. Trickier Forms
2. Perl References
3. Default Values
4. CGI Stickiness
5. JavaScript Actions
6. Input Validation 2
7. Multiple Submits
8. JavaScript Actions 2
9. Modules & mod_perl
10. Smartness
S. Summary


1. Remaining Features
2. Intro to Templates
3. HTML::Template
4. HTML::Template 2
5. Template Toolkit
6. Exploiting render()
7. Multi-Screen Apps
8. Multi-Screen Apps 2
9. Multi-Screen Apps 3
10. Custom Messages
S. Summary

Basic Tutorial - Step 1: Intro to FormBuilder Print

A Simple Form >>

Welcome to the FormBuilder Tutorial! This step-by-step tutorial will walk you through the usage of FormBuilder, from basic forms to advanced templates and multilingual messages. You can read these in series by clicking on the "Next" and "Previous" links, or skip directly to a topic using the navbar to the left.


FormBuilder is designed to handle all parts of a CGI form request - generation, submission, and validation. As such, FormBuilder applications will usually loop back on themselves. That is, you will have a single script that, when invoked, will take care of your entire application just based on the CGI parameters.

FormBuilder uses an Object-Oriented calling-style, but don't let that scare you away. Usage is exceedingly easy, as there are only a couple functions you need to know about. Throughout the documentation, our FormBuilder object will always be identified as $form, and you'll find this works equally well in your own scripts.

Here are the basic steps:

  1. Create a $form object with CGI::FormBuilder->new()
  2. Define your form fields with the $form->field() method.
  3. Check for whether the form was submitted with $form->submitted, and if so, validate it with $form->validate.
  4. Get to individual values using the $form->field() method, and do whatever you need to with the data (update a database, etc).
  5. If the form wasn't submitted (or fails validation), print it out using the main $form->render function.
That's all there is to it! FormBuilder will take care of HTML and JavaScript generation, table layout, validation, stickiness, error messages, and so forth. Let's look at a basic FormBuilder script.

A Simple Form >>

FormBuilder is © Nate Wiger, with contributions from many people.