X-Git-Url: http://git.shiar.net/perl/html-form-simple.git/blobdiff_plain/42e413b01d9303fffba217b94f5bc7b46ee7dac9..b54221df138e749a5c2fda079ea4d6241a278a7d:/lib/HTML/Form/Simple.pm diff --git a/lib/HTML/Form/Simple.pm b/lib/HTML/Form/Simple.pm index fa0420b..f96149f 100644 --- a/lib/HTML/Form/Simple.pm +++ b/lib/HTML/Form/Simple.pm @@ -213,12 +213,16 @@ sub check { } } exists $rows->[$_]->{value} or $rows->[$_]->{value} = $_ + 1 for 0 .. $#$rows; + $rows->[0]->{id} = $attr->{id} || $rows->[0]->{name} || $attr->{name} || $name #XXX: // + if ref $label ne 'ARRAY' and defined $rows->[0] and not defined $rows->[0]->{id}; $self->select($name, $rows, {%$attr, type => 'checkbox'}); } 1; +__END__ + =head1 NAME HTML::Form::Simple - Generate HTML form elements @@ -246,6 +250,47 @@ HTML::Form::Simple - Generate HTML form elements ); say $input->stop; # +=head1 DESCRIPTION + +=over + +=item C + + $input->hidden(name => 'value'); + +=item C + + $input->text(name => 'default'); + +=item C