Quoting "Sabherwal, Balvinder (MBS)" <[EMAIL PROTECTED]>:

> Can anyone tell me if this is the right way to append the values to a
> pre-defined scroll list column??
> 
> $output .= $q->scrolling_list(-name=> 'apps', -values=>"");
> $output .= $q->append(-name=>'apps', -values=>"$val");

No, this will not work the way you want.

> 
> This gives me output as below which is not correct.
> 
> <select name="apps" size="1">
> <option  value=""></option>
> </select>
> Landscape,Phhorce
> 
> I am trying to get something like this
> <select name="apps" size="1">
> <option  value="Landscape">Landscape</option>
> <option  value="Phhorce">Phhorce</option>
> </select>
> 
> I am trying to create a dropdown list on the form and want to put the
> values
> in the $val as option in the DD List.
> 
> The $val holds a string as "Landscape,Phhorce"

To create a dropdown list with a CGI object, you need to use a different method.
The method popup_menu() will create what is known as a "dropdown menu", where as  
the method scrolling_list() will create what is known as a "select box".  To 
create a dropdown menu, you need to supply the options for the list as an array 
reference.  Example:

$output .= $q->popup_menu(-name=> 'apps', -values=> ['option1', 'option2', 
'option3']);

or if you have an array of the options already, you could do this:

$output .= $q->popup_menu(-name=> 'apps', -values => \@my_options);

You can read more about it at: 
http://www.perldoc.com/perl5.6.1/lib/CGI.html#CREATING-A-POPUP-MENU


-spencer christensen
[EMAIL PROTECTED]

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

Reply via email to