Multiple Popup Menus Using Table Layout Control
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
print header, start_html;
print start_form,
h1("Pick your favorite food in each group!"),
table(
Tr(td([strong("Meat"), strong("Dairy"), strong("Vegetable"),
strong("Starch")])),
Tr( td([
popup_menu(-name => "meat", -values => ["beef", "lamb", "pork",
"chicken", "fish"]),
popup_menu(-name => "dairy", -values => ["milk", "ice cream",
"cheese", "yogurt"]),
popup_menu(-name => "veggie", -values => ["peas", "squash",
"broccoli", "carrots", "brussel sprouts", "green beans"]),
popup_menu(-name => "starch", -values => ["corn", "rice",
"potato", "oats", "bread"])]))),
submit(-name => "Submit Favorites"),
end_form;
if (param("Submit Favorites"))
{
$favorites = join(", ", param("meat"), param("dairy"), param("veggie"),
param("starch"));
print p("Your favorite foods are: $favorites\n");
}
print end_html;