| 1 | #!/usr/local/bin/perl |
| 2 | |
| 3 | use CGI; |
| 4 | $query = new CGI; |
| 5 | print $query->header; |
| 6 | print $query->start_html('Popup Window'); |
| 7 | |
| 8 | |
| 9 | if (!$query->param) { |
| 10 | print "<H1>Ask your Question</H1>\n"; |
| 11 | print $query->startform(-target=>'_new'); |
| 12 | print "What's your name? ",$query->textfield('name'); |
| 13 | print "<P>What's the combination?<P>", |
| 14 | $query->checkbox_group(-name=>'words', |
| 15 | -values=>['eenie','meenie','minie','moe'], |
| 16 | -defaults=>['eenie','moe']); |
| 17 | |
| 18 | print "<P>What's your favorite color? ", |
| 19 | $query->popup_menu(-name=>'color', |
| 20 | -values=>['red','green','blue','chartreuse']), |
| 21 | "<P>"; |
| 22 | print $query->submit; |
| 23 | print $query->endform; |
| 24 | |
| 25 | } else { |
| 26 | print "<H1>And the Answer is...</H1>\n"; |
| 27 | print "Your name is <EM>",$query->param(name),"</EM>\n"; |
| 28 | print "<P>The keywords are: <EM>",join(", ",$query->param(words)),"</EM>\n"; |
| 29 | print "<P>Your favorite color is <EM>",$query->param(color),"</EM>\n"; |
| 30 | } |
| 31 | print qq{<P><A HREF="cgi_docs.html">Go to the documentation</A>}; |
| 32 | print $query->end_html; |