$html .= qq[<select name="foo">]; for ('option1:One', 'option2:Two') { my ($val, $desc) = split /:/; my $sel = ($val eq $existing_value) ? ' selected' : ''; $html .= qq[<option value="$val"$sel>$desc]; } $html .= qq[</select>];
-- Chip Salzenberg, Free-Floating Agent of Chaos
In reply to Re: Dynamically marking a HTML select option as selected
by chip
in thread Dynamically marking a HTML select option as selected
by ezekiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |