X-Git-Url: http://git.shiar.net/perl/html-form-simple.git/blobdiff_plain/b54221df138e749a5c2fda079ea4d6241a278a7d..caa5688f6a17a31ad7c44f5c6b09c5f08dfde390:/lib/HTML/Form/Simple.pm diff --git a/lib/HTML/Form/Simple.pm b/lib/HTML/Form/Simple.pm index f96149f..440f404 100644 --- a/lib/HTML/Form/Simple.pm +++ b/lib/HTML/Form/Simple.pm @@ -171,7 +171,7 @@ sub select { sub radio { my $self = shift; - my ($name, $rows, $label, $attr) = $self->_attr(3, @_); + my ($name, $rows, $label, $default, $attr) = $self->_attr(4, @_); if (not defined $rows) { if (defined $label) { @@ -194,7 +194,7 @@ sub radio { } } - $self->select($name, $rows, {%$attr, type => 'radio'}); + $self->select($name, $rows, $default, {%$attr, type => 'radio'}); } sub check { @@ -252,25 +252,69 @@ HTML::Form::Simple - Generate HTML form elements =head1 DESCRIPTION +Set up a form object with new(). The HTML for the opening and closing +C<<
>> tags are returned by the start() and stop() methods. + +The L, L, L >> with specified name +and value (both are required by HTML specs). + + $input->hidden('name', 'value'); + +As with all methods, a final hash ref can be given to add further attributes. +While rarely needed in this case, it can also be used as an override or +alternative to value and name: + + $input->hidden({name => 'name', value => 'value'}) =item C - $input->text(name => 'default'); +The common C<< >>. + + $input->text('name', 'default'); + +If the I option is set, substitutes a similarly set up C<<