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

Basic

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

Intermediate

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

Advanced

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 3: Form Method Print

<< A Simple Form | Input Validation >>

By default, FormBuilder sends form data via get, as the CGI specification states. However, for many types of forms, you want to send them via post, since this prevents caching and bookmarking on the client side.

Doing so is easy, simply change the method in new():

$form = CGI::FormBuilder->new(
             method => 'post',
             fields => \@fields,
        );
(Note: The order you specify options in never matters to FormBuilder.)

In fact, you can pass in any valid <form> tag attribute and it will go directly into the top of the form:

$form = CGI::FormBuilder->new(
             method  => 'post',
             name    => 'personal_info',
             enctype => 'multipart/form-data',
             fields  => \@fields,
        );
Naming your form with the name option has special usefulness with multi-screen forms, as we'll see later.

Finally, note that you can change the action in the same way, although usually for FormBuilder applications this is not desired (since FormBuilder handles the entire process).

Take a minute to play around with this script in action, and view the source as well.

<< A Simple Form | Input Validation >>

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