7 print $query->start_html('Multiple Forms');
8 print "<H1>Multiple Forms</H1>\n";
10 # Print the first form
11 print $query->startform;
12 $name = $query->remote_user || 'anonymous@' . $query->remote_host;
14 print "What's your name? ",$query->textfield('name',$name,50);
15 print "<P>What's the combination?<P>",
16 $query->checkbox_group('words',['eenie','meenie','minie','moe']);
17 print "<P>What's your favorite color? ",
18 $query->popup_menu('color',['red','green','blue','chartreuse']),
20 print $query->submit('form_1','Send Form 1');
21 print $query->endform;
23 # Print the second form
25 print $query->startform;
26 print "Some radio buttons: ",$query->radio_group('radio buttons',
27 [qw{one two three four five}],'three'),"\n";
28 print "<P>What's the password? ",$query->password_field('pass','secret');
29 print $query->defaults,$query->submit('form_2','Send Form 2'),"\n";
30 print $query->endform;
34 $query->import_names('Q');
36 print "<H2>Form 1 Submitted</H2>\n";
37 print "Your name is <EM>$Q::name</EM>\n";
38 print "<P>The combination is: <EM>{",join(",",@Q::words),"}</EM>\n";
39 print "<P>Your favorite color is <EM>$Q::color</EM>\n";
40 } elsif ($Q::form_2) {
42 <H2>Form 2 Submitted</H2>
43 <P>The value of the radio buttons is <EM>$Q::radio_buttons</EM>
44 <P>The secret password is <EM>$Q::pass</EM>
48 print qq{<P><A HREF="./">Other examples</A>};
49 print qq{<P><A HREF="../cgi_docs.html">Go to the documentation</A>};
51 print $query->end_html;