Sorry, yes my example wasn't very clear. If -default is set to one of the values, then the correct item in the list is selected. I think you can get the required value from your %userRecord hash.
If I change the code to:
print popup_menu(-name => 'foo',
-values => \@quantities,
-labels => \%labels,
-default => 25);
Then I get the following output:
<select name="foo" >
<option value="1">Individual</option>
<option value="5">5</option>
<option value="10">10</option>
<option selected="selected" value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
--
< http://dave.org.uk>
"The first rule of Perl club is you do not talk about
Perl club." -- Chip Salzenberg
|