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 8: Field Attributes Print

<< Field Data | HTML Formatting >>

Of course, in addition to options, there are a lot of "little things" one often has to do to a field, such as changing its length.

Well, just like changing the form attributes for our <form> tag, changing any tag you can think of for a field is done simply by specifying that tag to the field() method:

$form->field(name  => 'first_name',
             type  => 'text',       # default
             size  => 40,
             maxlength => 80);
These changes would result in the following HTML tag:
<input name="first_name" type="text" size="40" maxlength="80">
In fact, any extra attributes you specify that are not recognized FormBuilder options will be transferred directly into the HTML tag. This ensures that FormBuilder will not go out of date when HTML 12.4 comes out.

You can change a couple other things about a field as well:

$form->field(name   => 'first_name',
             label  => 'Your First Name',   # override label
             value  => 'anonymous',         # override value
             comment=> '(first and last)'); # printed after field
You can view the complete documentation on the field() method, which includes some options we'll look at a little later.

<< Field Data | HTML Formatting >>

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