#!/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 "<H1>This is the Popup Window!</H1>\n"; ################################################ # # Start form in a new HTML window print startform(-target=>'_new'); ######################################################## # # Check box group: Can choose more than one. print "<p>Your favorite snacks (More than just one!)<p> ", checkbox_group(-name=>'snack', -values=>['water','pizza', 'chocolate','sushi'], -defaults=>['water']); ######################################################## # # Popup Menu print "<P>Your favorite drink? ", popup_menu(-name=>'drink', -values=>['water','cola', 'beer','selzter']); print p; print submit; print endform; } else { print "<H1>Out of the Popup window</H1>\n"; print "<P>Snack(s): <EM>", join(",",param(snack)),"</EM>\n"; print "<P>The drink is: <EM>",param(drink),"</EM>\n"; } print end_html;