"Sabherwal, Balvinder (MBS)" wrote:
>
> Guru's
>
> I have a script which makes a database call and the returned results are
> stored in a variable. if I pass this variable to the popup_menu, the options
> I get in the list box are array references. Is there a way to pass the
> variable to the popup_menu function or will I have to convert the variable
> to an array and pass. The code I use is as below:
Here's the kind of constructs I use:
my %states =
@{$DBH->selectcol_arrayref("SELECT code,name FROM cas_state_codes",
{Columns=>[1,2]})};
#### ...
$q->popup_menu(
-name=>'state',
-values=>[ sort { $states{$a} cmp $states{$b} } keys
%states ],
-labels=>\%states,
);
-mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]