#!/usr/local/bin/perl
#############################################
#
# popup.cgi
#
#
use CGI qw(:standard);
print header,
start_html('Popup.cgi');
##############################################
#
# Use logical not operator to force the absence
# of parameters to be "true"
if (!param) {
print "This is the Popup Window!
\n";
################################################
#
# Start form in a new HTML window
print startform(-target=>'_new');
########################################################
#
# Check box group: Can choose more than one.
print "Your favorite snacks (More than just one!)
",
checkbox_group(-name=>'snack',
-values=>['water','pizza',
'chocolate','sushi'],
-defaults=>['water']);
########################################################
#
# Popup Menu
print "
Your favorite drink? ",
popup_menu(-name=>'drink',
-values=>['water','cola',
'beer','selzter']);
print p;
print submit;
print endform;
} else {
print "
Out of the Popup window
\n";
print "Snack(s): ",
join(",",param(snack)),"\n";
print "
The drink is: ",param(drink),"\n";
}
print end_html;