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

Intermediate Tutorial - Step 10: Smartness Print

<< Modules & mod_perl | Summary >>

As we've seen repeatedly, FormBuilder does a lot of stuff for you automatically. In the majority of cases, this is good, but there may be occassion where you want FormBuilder to be a little "stupider" and just generate and process basic HTML and JavaScript.

This is easy to do, simply tweak the smartness option:

$form = CGI::FormBuilder->new(
             fields => \@fields,
             smartness => 0      # dare to be stupid
Conversely, there's a whole bunch of stuff that FormBuilder can do but doesn't by default. For example, FormBuilder can automatically guess at the type of field something should be, just based on its name. For example, a field including the regex passw[or]*d would become type password, a field including the term "comments" could become type textarea, and so on.

If you want stuff like this, including automatic field validation and options, turn up the smartness:

$form = CGI::FormBuilder->new(
             fields => \@fields,
             smartness => 2      # genius level IQ
To see how much stuff this does for you, take a look at this smart version of the form method script that we saw way back in the Basic Tutorial. Make sure to check out the HTML source for comparison. (The original script is here)

<< Modules & mod_perl | Summary >>

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