...

View Full Version : arrays in select tag - adding a new line



radiation
05-04-2009, 03:23 AM
Hi,
I am trying to populate a selection box, using the content of an array as the options. My problem is that all the items of the array are ending up on the one line, and not as seperate selection items.

my code is something like this:


my @array = ("1", "2", "3");
my $cgi = new CGI;
$cgi->Select(
{-multiple=>'multiple'},
$cgi->option(@array)
)

Thanks

FishMonger
05-04-2009, 04:53 AM
Please don't post code that is "something like this". Post the actual code that you tried.

Start by reading the documentation for the CGI module that pertains to what you're needing.

http://search.cpan.org/~lds/CGI.pm-3.43/CGI.pm#CREATING_A_POPUP_MENU
http://search.cpan.org/~lds/CGI.pm-3.43/CGI.pm#CREATING_AN_OPTION_GROUP
http://search.cpan.org/~lds/CGI.pm-3.43/CGI.pm#CREATING_A_SCROLLING_LIST

If, after reading the CGI doc and reworking your code, you don't understand what you need to do, post back with the actual code you tested.

radiation
05-04-2009, 06:13 AM
Thankyou



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum