Where do you want *them* to go today?#!/perl/bin/perl use strict; use warnings; use Data::Dumper; # Fish configurator my %fish = ( "Fresh water fish" => "fish1.jpg", "Salt water fish" => "fish2.jpg", "One fish" => "seuss1.jpg", "Two fish" => "seuss2.jpg", "Thanks for all the fish" => "adams.jpg", ); print qq(<form> <select name="fish"> ); # Print each fish's <option> line for my $pet (sort keys %fish) { # Note that $pet is the hash key # ... and $fish{$pet} refers to the value print sprintf qq(<option value="%s">%s</option>\n), $fish{$pet}, $pet; } print qq(</select> </form>); __OUTPUT__ <form> <select name="fish"> <option value="fish1.jpg">Fresh water fish</option> <option value="seuss1.jpg">One fish</option> <option value="fish2.jpg">Salt water fish</option> <option value="adams.jpg">Thanks for all the fish</option> <option value="seuss2.jpg">Two fish</option> </select> </form>
In reply to Re: Drop-down list Option Value
by thezip
in thread Drop-down list Option Value
by Happyjack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |