Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: cgi.pm: popup_menu

by crenz (Priest)
on Mar 14, 2003 at 19:24 UTC ( [id://243156]=note: print w/replies, xml ) Need Help??


in reply to cgi.pm: popup_menu

keys %labels should do the trick.

Replies are listed 'Best First'.
Re: Re: cgi.pm: popup_menu
by arturo (Vicar) on Mar 14, 2003 at 21:31 UTC

    the -labels attribute expects an array reference, not a list, so that should instead be -labels => [ keys %labels ]

    the [ ] around the keys %labels makes it an anonymous array, which is a reference to an array with no name.

    HTH

    If not P, what? Q maybe?
    "Sidney Morgenbesser"

Re: Re: cgi.pm: popup_menu
by slackah (Initiate) on Mar 15, 2003 at 03:03 UTC
    its not working though, and when i do this

    my @temp = keys %labels;
    my $temp2;
    foreach(@temp) {
    $temp2.="'$_'";
    $temp2.=",";
    }
    chop $temp2;

    print $q->popup_menu(-name=>'menu_name', -values=>$temp2, -default => $q->param('product'), -labels=>%labels);

    It just prints $temp2 as one value.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://243156]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found