HTML::FormStructure is a Perl module to hold definition of FORM in your script. It have the part of generating FORM tags, validating via itself, and storeing cgi(apache request)'s parameters. You can access this object in the perl souce code or templates.
SYNOPSIS
use HTML::FormStructure;
use CGI;
$cgi = CGI->new;
$option = { form_accessors => [qw(foo bar baz)],
query_accessors => [qw(foo bar baz)], };
$form = HTML::FormStructure->new(
&arrayref_of_queries,
$cgi_object,
$option
);
sub arrayref_of_queries {
return [{
name => 'user_name',
type => 'text',
more => 6,
less => 255,
column => 1,
},{
name => 'email',
type => 'text',
more => 1,
less => 255,
be => [qw(valid_email)],
column => 1,
},{
name => 'sex',
type => 'radio',
value => [1,2],
checked => 1,
column => 1,
},{
name => 'birthday',
type => 'text',
be => [qw(valid_date)],
more => 1,
less => 255,
column => 1,
consist => [{
name => 'year',
type => 'text',
more => 1,
less => 4,
be => [qw(is_only_number)],
},{
name => 'month',
type => 'text',
more => 1,
less => 2,
be => [qw(is_only_number)],
},{
name => 'day',
type => 'text',
more => 1,
less => 2,
be => [qw(is_only_number)],
}];
}];
}
Product's homepage
Requirements:
· Perl