in reply to Re^2: How to select many times from a drop down menu in the same form
in thread How to select many times from a drop down menu in the same form

scrolling list
  • Comment on Re^3: How to select many times from a drop down menu in the same form

Replies are listed 'Best First'.
Re^4: How to select many times from a drop down menu in the same form
by Nik (Initiate) on May 06, 2007 at 08:17 UTC
    i tried 'scrolling_list' but because of the amount of items listed inside columns gets huge so i will exclude this as an option. I need another alterntive but popup_menu is fine if i can select multiple valeus in it.

      What? That makes no sense. You really need to get a better handle at the HTML that is generated by CGI. Both scrolling_list and popup_menu produce and HTML select list. The only difference between the two are scrolling_list allows multiple selects and scrolling_list lets you set the size of the window.

      #!/usr/bin/perl use strict; use warnings; use CGI qw/:standard/; print popup_menu( -name => 'color_pm', -values => [ 'red', 'green', 'blue', 'chartreuse' ] ), "\n\n", scrolling_list( -name => 'color_sl', -values => [ 'red', 'green', 'blue', 'chartreuse' ], -size => 3, -multiple => 'true' );
      produces:
      <select name="color_pm" > <option value="red">red</option> <option value="green">green</option> <option value="blue">blue</option> <option value="chartreuse">chartreuse</option> </select> <select name="color_sl" size="3" multiple="multiple"> <option value="red">red</option> <option value="green">green</option> <option value="blue">blue</option> <option value="chartreuse">chartreuse</option> </select>
      so if your window *gets huge" pass the appropriate options to reduce its size.

      -derby
        True, but aesthitically drop down menu its more nice for me :). What i f i ahve 50 items how will i be able to display them in a single cell inside a table? it will mess the whole table up while pop menu wont. :)