Multiple selection values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bung

    Multiple selection values

    I am trying to retrieve selected values from a multiple select object
    on a page:

    *** Selection Page ***
    <form name="theForm">
    <select name="numbers" MULITPLE>
    <option value="1">One</option>
    <option value="2">Two</option>
    <option value="2">Three </option>
    </select>
    </form>

    What I want to do is to pass the selected values from "Selection page"
    to its parent window. Right now, I pass the values by doing this (in
    JavaScript):

    window.opener.p arentForm.num.v alue = document.theFor m.numbers.value ;

    I'm assuming if mulitple selections are made (lets say One and Two are
    selected), document.theFor m.numbers.value will be a collection of the
    selected option values. Is this correct?

    If so, how can I retrieve each option value when coding parent window?


    Thanks.

    BUNG
  • Lasse Reichstein Nielsen

    #2
    Re: Multiple selection values

    bung@telusplane t.net (Bung) writes:
    [color=blue]
    > I'm assuming if mulitple selections are made (lets say One and Two are
    > selected), document.theFor m.numbers.value will be a collection of the
    > selected option values. Is this correct?[/color]

    No. It will just be the first selected option. You have to run through the
    options manually to see which are selected.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...