in reply to Re: Form File Field
in thread Form File Field
<form> Foo <input value="foo" type="radio" name="pic" /><br /> Bar <input value="bar" type="radio" name="pic" /><br /> Baz <input value="baz" type="radio" name="pic" /> </form>Otherwise, your input fields should not share the same name.
There are a couple of ways to make radio buttons in Perl without to much fuss ... the first is by brute force, much like you did in your question. However, since the "stuff" from your tab delimited file is already stored in the array @fields, we can iterate across the loop and not have to worry about whether or not we are dealing with the second index or the eleventh index:
CGI.pm has a very handy method for generating radio boxes:print "<form>\n"; for my $field (@fields) { print qq|<input value="$field" type="radio" name="pic" /><br />\n|; } print "</form>\n";
I recommend that you visit and read Ovid's online Web Programming with Perl course. You will learn a lot of good stuff there. :)use CGI qw(:standard); print start_form, radio_group(-name => 'pic', -values => \@field), end_form, ;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|