Hello All,

I have a test form called pbauto, that displays 3 choices of magazines and
upon submit, calls itself to print out what parameters were passed. I want
to allow the user to select more than one magazine so I specify the
option multiple=>1 for this. The web form seems to do the right thing,
highlighting more than one magazine if I hold the ctrl-key down. But when
I submit the form the parameters passed only include my first choice. I'm
not sure what the option multiple => 1 means to the browser but I thought
it would pass all my choices as a single blank-delimited string ($url is
replaced with the url that allows you to run cgi scripts. I change this
to my url when I run this script). I tried this on Mozilla, IE, and
Netscape but get the same behavior. I'm using perl version 5.6.1 on linux.
Any advice would be highly appreciated. thanks, Chee


Here's the code:

#!/usr/local/bin/perl -w

use strict;
use CGI qw(:standard :html3);
our(@catArray, $val, $url);
@catArray = ("Time Magazine","MIT Technology","Herbalist");

print header,
start_html('Subscribe'),
h3('Subscriptions');

if ( param() ){          # the form has been submitted
   foreach ( param() ){
     $val = param($_);
     print h4("$_ = $val");
   }
}else {                  # first time form is displayed
   print start_form(-method=>"POST", -action=>"$url/pbauto");
   print h3("Enter Your Name"),p;
   print textfield(-name=>"Name", -size=>20),p;
   print h3("Choose Your Subscriptions"),p;
   print scrolling_list("choice",[EMAIL PROTECTED], undef,6,multiple=>1),
   p;
   print submit(-name=>"submit",-value=>"submit");
   print reset(-name=>"reset",-value=>"reset");
}
print end_html;

exit;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to