Re: multiple selection

2002-11-23 Thread fliptop
On Fri, 22 Nov 2002 at 15:56, Mike(mickako)Blezien opined:

M:   @lists = split(/ /,param('list'));

from perldoc CGI:

FETCHING THE VALUE OR VALUES OF A SINGLE NAMED PARAMETER:

   @values = $query-param('foo');

 -or-

   $value = $query-param('foo');



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: multiple selection

2002-11-23 Thread Jason Purdy
Two things:
1) Your action parameter of the form tag was pointing to a separate program.
If you leave it blank (or leave it out altogether), then this same script
will process it.
2) You don't need to split param('list') - CGI.pm will automatically make an
array for you, if it contains multiple entries.

HTH  Have Fun!

Jason

#!/usr/local/bin/perl
use CGI qw(:standard);

$action = param('action');

print header();
print start_html();

  if (!$action) {
print start_html();
print qq~
form method=POST action=
input type=hidden name=action value=doit
font face=arial size=2BSelect List:/BP
~;
print scrolling_list(
-name='list',
-value=['List_1','List_2','List_3'],
-default=['List_1'],
-multiple=1
);
print qq~
input type=submit value=Submit/form
~;
print end_html();
   } else {
@lists = param('list');
print qq|Total: @lists|;
   }

exit();

Mikeblezien [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all,

 having a problem with processing multiple selection from a scrolling
list...
 first time working with tha scrolling list. Here is the test script I'm
working
 with:
 #!/usr/local/bin/perl
 use CGI qw(:standard);

 $action = param('action');

 print header();
 print start_html();
   if (!$action) {
 print start_html();
 print qq~
 form method=POST action=/mailer/cgi/list.pl
 input type=hidden name=action value=doit
 font face=arial size=2BSelect List:/BP
 ~;
 print scrolling_list(-name='list',
   -value=['List_1','List_2','List_3'],
   -default=['List_1'],
   -multiple=1);
 print qq~
 input type=submit value=Submit/form
 ~;
 print end_html();
} else {
@lists = split(/ /,param('list'));
 print qq|Total: @lists|;
}

 exit();

 Now I thought that the @list array would store all the selected values
from the
 list... but it doesn't, just one, even if all the items have been selected
from
 the list... what am I missing here ??

 thanks
 --
 MikemickaloBlezien
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Thunder Rain Internet Publishing
 Providing Internet Solutions that work!
 http://www.thunder-rain.com
 Tel:  1(985)902-8484
 MSN: [EMAIL PROTECTED]
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




multiple selection

2002-11-22 Thread Mike(mickako)Blezien
Hello all,

having a problem with processing multiple selection from a scrolling list... 
first time working with tha scrolling list. Here is the test script I'm working 
with:
#!/usr/local/bin/perl
use CGI qw(:standard);

$action = param('action');

print header();
print start_html();
 if (!$action) {
print start_html();
print qq~
form method=POST action=/mailer/cgi/list.pl
input type=hidden name=action value=doit
font face=arial size=2BSelect List:/BP
~;
print scrolling_list(-name='list',
 -value=['List_1','List_2','List_3'],
 -default=['List_1'],
 -multiple=1);
print qq~
input type=submit value=Submit/form
~;
print end_html();
  } else {
  @lists = split(/ /,param('list'));
print qq|Total: @lists|;
  }

exit();

Now I thought that the @list array would store all the selected values from the 
list... but it doesn't, just one, even if all the items have been selected from 
the list... what am I missing here ??

thanks
--
MikemickaloBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel:  1(985)902-8484
MSN: [EMAIL PROTECTED]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]