in reply to Params in CGI
Echo above sentiments: radio is completely wrong for this. You want checkboxes. Here's a snippet to play with. Sorry it's not adapted to your code above but I did it for fun. :) You can swap CGI for CGI::Pretty. The only difference is the output is better for human consumption with the pretty version.
use strict; use warnings; use CGI::Pretty; my $cgi = CGI::Pretty->new(); print $cgi->header(), $cgi->start_html(); if ( my @selected = $cgi->param("catzez") ) { print $cgi->h1("You be checkin..."); print $cgi->ul( $cgi->li( \@selected ) ); } else { print $cgi->h1("You chex sumdings, pleez."); } print $cgi->start_form(), $cgi->checkbox_group( -name => "catzez", -cols => 3, -values => [ "Oh, hai!", "Oh, NOES!", "Oh, Pl +eaze!", "I can haz PurlMunkz?", "Hacks. I gots dem.", "PERL. Yur doin it rong.", "Golf. Yer doin it... Pretty wel +l akshully.", "Wherz mah buckit?", "They takes + mah buckit!" ], ), $cgi->submit("Go, goez!"); $cgi->end_form(), $cgi->end_html();
|
|---|