Getting Everything from a <select multiple>

Discussion in 'HTML' started by Jayenkai, Feb 15, 2004.

  1. Jayenkai

    Jayenkai Guest

    http://jnk.homedns.org/cgi-bin/formforfone1.pl

    ^^ I've finally downloaded the script I needed to move those little
    items about my 4 columns..
    But now I've stumbled across a slight problem.
    I can't actually figure out what's IN each list, without requireing
    that each list has it's items selected before the user clicks Send.

    Does anyone know how I can access the results from this page, or of
    any other alternative?
     
    Jayenkai, Feb 15, 2004
    #1
    1. Advertisements

  2. Jayenkai

    Tobias Wolff Guest

    Jayenkai wrote:
    > http://jnk.homedns.org/cgi-bin/formforfone1.pl
    >
    > ^^ I've finally downloaded the script I needed to move those little
    > items about my 4 columns..
    > But now I've stumbled across a slight problem.
    > I can't actually figure out what's IN each list, without requireing
    > that each list has it's items selected before the user clicks Send.
    >
    > Does anyone know how I can access the results from this page, or of
    > any other alternative?


    You have got two alternatives:

    1. Either you remember these items you added in a javascript array, so
    that on submit you can pass these items to the target script by setting
    some hidden fields in the form.

    2. You can gather the items inside of selects by using it's "options"
    property.

    var strItems = '';
    for(intI = 0; intI < objSelect.options.length; intI++)
    {
    strItems += objSelect.options[intI].value; // or ___.text;

    if(intI < objSelect.options.length - 1)
    {
    strItems += ',';
    }
    }

    Now you have got a comma separated list of all items in the list and
    pass them to the script with a hidden field.

    Hope this helps,
    Tobias.
     
    Tobias Wolff, Feb 15, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFiYmxlcg==?=

    select gridview row without using select button?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 3, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    101,981
    dch31969
    Feb 27, 2009
  2. J. Hall
    Replies:
    2
    Views:
    1,448
    Jeff Thies
    Apr 21, 2004
  3. jas

    select.select() on windows

    jas, Oct 25, 2005, in forum: Python
    Replies:
    4
    Views:
    944
    Maksim Kasimov
    Oct 27, 2005
  4. Laszlo Nagy

    select.select and socket.setblocking

    Laszlo Nagy, Dec 30, 2008, in forum: Python
    Replies:
    12
    Views:
    1,467
    Roy Smith
    Jan 3, 2009
  5. Jean-Paul Calderone

    Re: select.select and socket.setblocking

    Jean-Paul Calderone, Dec 30, 2008, in forum: Python
    Replies:
    1
    Views:
    431
    Francesco Bochicchio
    Dec 31, 2008
  6. palmiere
    Replies:
    1
    Views:
    696
    Erwin Moller
    Feb 9, 2004
  7. Ferd Berfel
    Replies:
    4
    Views:
    348
  8. Max
    Replies:
    5
    Views:
    444
    Thomas 'PointedEars' Lahn
    Apr 14, 2008
Loading...