in reply to Re^4: 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

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

Replies are listed 'Best First'.
Re^6: How to select many times from a drop down menu in the same form
by Nik (Initiate) on May 06, 2007 at 14:34 UTC
    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. :)
      You restrict the size of your list via CSS. The list will have scrollbars.

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        Yes i see what you mean that can be done, and if wedo it thsi way there is no need for Javascipt code now, right?
          A reply falls below the community's threshold of quality. You may see it by logging in.