she2
asked on
in mutiple selection list, how to get the selected item?
in the Html, I use mutiple selection list, how to get the selected item?
in the cgi(or Pl) , how to get the selected item?
in the cgi(or Pl) , how to get the selected item?
Sorry, the first line shld read,
if ($ENV{'REQUEST_METHOD'} =~ /POST/i)
if ($ENV{'REQUEST_METHOD'} =~ /POST/i)
Actually the above correction wasn't necessary. I tried it only after I posted it !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the same method is used to get values from all form input contols
ASKER
makerp:
thanks!, but $query->param('selection1' )
should be arry of string, how to set up the array of string, and how to access?
thanks!, but $query->param('selection1'
should be arry of string, how to set up the array of string, and how to access?
@values = $query->param('selection1'
If ur select box has name 'sel_list',
if ($ENV{REQUEST_METHOD} =~ /POST/i)
{
read(STDIN, $cache, $ENV{'CONTENT_LENGTH'});
}
else
{
$cache = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $cache);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9]
$FORM{$name} = $value;
}
print "the selected value is $FORM{'sel_list'}";