This is one area where CGI.pm's HTML generation functions are really good.
@quantities = ('1','5','10','25','50','100'); my %labels = map { $_ => $_ } @quantities; $labels{1} = 'Individual'; print popup_menu(-name => 'foo', -values => \@quantities, -labels => \%labels, -default => $userRecord{$pack_qty});
The code above gives the following output:
<select name="foo" > <option value="1">Individual</option> <option value="5">5</option> <option value="10">10</option> <option value="25">25</option> <option value="50">50</option> <option value="100">100</option> </select>
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: Generating Select elements with foreach loops
by davorg
in thread Generating Select elements with foreach loops
by pickledegg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |