use strict;
use vars qw($VERSION);
-$VERSION = '0.02';
+$VERSION = '0.03';
=head1 NAME
'form_action' => 'process.cgi',
'form_text' => [ qw( textfield1 textfield2 ) ],
'form_checkbox' => [ qw( checkbox1 ) ],
+ 'form_radio' => [ qw( radio1 ) ],
+ 'form_select' => [ qw( select1 ) ],
'layer_callback' => sub {
my $layer = shift;
my $html = qq!<INPUT TYPE="hidden" NAME="layer" VALUE="$layer">!;
form_checkbox - (optional) Array reference of checkbox form fields to copy from
the B<form_name> form.
+form_radio - (optional) Array reference of radio form fields to copy from the
+ B<form_name> form.
+
form_select - (optional) Array reference of select (not select multiple) form
fields to copy from the B<form_name> form.
exists($self->{form_text}) ? $self->{form_text} : [];
my $form_checkbox =
exists($self->{form_checkbox}) ? $self->{form_checkbox} : [];
+ my $form_radio =
+ exists($self->{form_radio}) ? $self->{form_radio} : [];
my $form_select =
exists($self->{form_select}) ? $self->{form_select} : [];
$html .= <<END;
<FORM NAME="${key}$layer" ACTION="$form_action" METHOD=POST onSubmit="${key}fixup(this)">
END
- foreach my $f ( @$form_text, @$form_checkbox, @$form_select ) {
+ foreach my $f ( @$form_text, @$form_checkbox, @$form_radio, @$form_select )
+ {
$html .= <<END;
<INPUT TYPE="hidden" NAME="$f" VALUE="">
END
exists($self->{form_text}) ? $self->{form_text} : [];
my $form_checkbox =
exists($self->{form_checkbox}) ? $self->{form_checkbox} : [];
+ my $form_radio =
+ exists($self->{form_radio}) ? $self->{form_radio} : [];
my $form_select =
exists($self->{form_select}) ? $self->{form_select} : [];
my $html = "
what.$f.value = '';\n"
}
+ foreach my $f ( @$form_radio ) {
+ $html .= "what.$f.value = '';
+ for ( i=0; i< document.$form_name.$f.length; i++ )
+ if ( document.$form_name.${f}[i].checked )
+ what.$f.value = document.$form_name.${f}[i].value;\n";
+ }
+
foreach my $f ( @$form_select ) {
$html .= "what.$f.value = document.$form_name.$f.options[document.$form_name.$f.selectedIndex].value;\n";
}