kelcey has asked for the wisdom of the Perl Monks concerning the following question:

How can I print all multi selected values from scrolling_list

Replies are listed 'Best First'.
Re: CGI Question
by Hot Pastrami (Monk) on Jan 05, 2001 at 02:31 UTC
    use CGI; my $query = CGI->new(); my @selected = $query->param("listName");

    ...and from CGI.pm:
    #### Method: param # Returns the value(s)of a named parameter. # If invoked in a list context, returns the # entire list. Otherwise returns the first # member of the list.
    Hot Pastrami
Re: CGI Question
by antjock (Novice) on Jan 05, 2001 at 05:42 UTC

    And to state it a little further, you might do something like:

    foreach $field ( @selected ) { @value = $q->param( "$field" ); $value = join( ",", @value ); print "$field: $value\n"; }

    Or at least that's how I just did it...

    I add the join() in there to tidy up the output a bit.

    cheers

      thanks, that what I come up with