my @choices = ("Make a selection", "Yes", "No" ); my $UsersChoice = GetUsersChoiceFromDB($user); my $selected = ""; print "<select name=whatever>"; foreach $choice ( @choices ) { if ( $choice eq $UsersChoice ){ $selected = "SELECTED" } else ( $selected = ""; } print "<option $selected value=$choice>$choice"; } print "</select>";
In reply to Re: Selecting a value on a pull-down menu
by wardk
in thread Selecting a value on a pull-down menu
by rodry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |