in reply to Select data rows from a grid with Perl
The way you normally approach this is by also giving the checkboxes a value (and in that case it helps if you give them all the same name, since they are related)...
#!/usr/bin/perl -w use CGI; my $cgi = CGI->new; print $cgi->header, $cgi->start_html, $cgi->start_form; if ( my @selected = $cgi->param( 'my_checkbox' ) ) { print "<hr>\n"; print "<p>You selected: ".join( ', ', @selected )."</p>\n"; } print "<ul>\n"; for my $x ( 1 .. 100 ) { print qq{<li><input type="checkbox" name="my_checkbox" value="$_"> + $_</li>\n}; } print "</ul>\n"; print $cgi->submit,$cgi->end_form, $cgi->end_html;
Also look at [cpan://
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Select data rows from a grid with Perl
by Anonymous Monk on Dec 23, 2008 at 20:25 UTC | |
by Anonymous Monk on Dec 23, 2008 at 20:42 UTC | |
by u671296 (Sexton) on Dec 24, 2008 at 00:41 UTC |
In Section
Seekers of Perl Wisdom