60
60
If this is your first time using B<FormBuilder>, you should check out
61
the website for tutorials and examples:
65
You should also consider joining the mailing list by sending an email to:
67
fbusers-subscribe@formbuilder.org
61
the website for tutorials and examples at L<http://formbuilder.org>.
63
You should also consider joining the google group at
64
L<http://groups.google.com/group/perl-formbuilder>.
69
65
There are some pretty smart people on the list that can help you out.
1082
1078
it required. However, you can use the C<required> option to change
1083
1079
this, see it for more details.
1085
Let's look at a concrete example:
1081
Let's look at a concrete example. Note that the javascript
1082
validation is a negative match, while the perl validation
1083
is a positive match.
1087
1085
my $form = CGI::FormBuilder->new(
1089
qw(username password confirm_password
1090
first_name last_name email)
1093
username => [qw(nate jim bob)],
1094
first_name => '/^\w+$/', # note the
1095
last_name => '/^\w+$/', # single quotes!
1097
password => \&check_password,
1098
confirm_password => {
1099
javascript => '== form.password.value',
1100
perl => 'eq $form->field("password")'
1087
username password confirm_password
1088
first_name last_name email
1091
username => [qw(nate jim bob)],
1092
first_name => '/^\w+$/', # note the
1093
last_name => '/^\w+$/', # single quotes!
1095
password => \&check_password,
1096
confirm_password => {
1097
javascript => '!= form.password.value', # neg
1098
perl => 'eq $form->field("password")', # pos
1105
1103
# simple sub example to check the password
1106
1104
sub check_password ($) {
1283
1281
$form->field(name => 'email', size => '40');
1283
=item add_after_option => $html
1285
Adds the specified HTML code after each checkbox (or radio) option.
1287
=item add_before_option => $html
1289
Adds the specified HTML code before each checkbox (or radio) option.
1285
1291
=item columns => 0 | $width
1287
1293
If set and the field is of type 'checkbox' or 'radio', then the
2725
Copyright (c) 2000-2006 Nate Wiger <nate@wiger.org>. All Rights Reserved.
2733
Copyright (c) L<Nate Wiger|http://nateware.com>. All Rights Reserved.
2727
2735
This module is free software; you may copy this under the terms of
2728
2736
the GNU General Public License, or the Artistic License, copies of