Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    arrays in select tag - adding a new line

    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:

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

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,872
    Thanks
    2
    Thanked 164 Times in 159 Posts
    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...G_A_POPUP_MENU
    http://search.cpan.org/~lds/CGI.pm-3...N_OPTION_GROUP
    http://search.cpan.org/~lds/CGI.pm-3...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.

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thankyou


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •