dynamic select: query value option in IE6 returns empty, mozillaoke why

Discussion in 'Javascript' started by Arjen, Jun 26, 2004.

  1. Arjen

    Arjen Guest

    IE 6 does not return the value of a dynamic option list. Mozilla
    performs fine. How can I get the value of a choice in IE?

    Simple example below. Option list is filled with first element of array
    store.

    Arjen

    <html>
    <head>
    <script language="javascript" type="text/javascript">
    var store = new Array();
    store[1] = new Array([3,0,0],[4,0,1],[5,0,1]);
    store[2] = new
    Array(['13',0,0],['14',0,0],['15',0,0],['16',0,1],['18',0,0]);

    function vuldikte()
    {
    var box = document.offerte.soort;
    var number = box.options[box.selectedIndex].value;
    var list = store[number];
    var diktelijst= document.offerte.breedte;
    diktelijst.options.length = null;
    for(i=0;i<list.length;i+=1)
    {
    diktelijst.options = new Option(list[0]);
    alert(diktelijst.options.value);
    // !! ----> ie 6 returns empty value of the options list, WHY ?
    }
    }
    </script>
    </head>
    <body>
    <form name="offerte">
    <select class="invoer" name="soort" size="1" onchange="vuldikte()">
    <option value="1">Klein</option>
    <option value="2">Groot</option>
    </select>
    <select class="invoer" name="breedte" size="1">
    <option value="10">Kies option</option>
    </select>&nbsp;breedte
    </form>
    </body>
    </html>
     
    Arjen, Jun 26, 2004
    #1
    1. Advertising

  2. Re: dynamic select: query value option in IE6 returns empty,mozilla oke why

    Arjen <> writes:

    > IE 6 does not return the value of a dynamic option list. Mozilla
    > performs fine. How can I get the value of a choice in IE?
    >
    > Simple example below. Option list is filled with first element of
    > array store.


    Try:
    > diktelijst.options.length = null;

    ... = 0;
    and:
    > diktelijst.options = new Option(list[0]);

    ... = new Option(list[0], list[0]);

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Jun 26, 2004
    #2
    1. Advertising

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. Yan-Hong Huang[MSFT]

    RE: ADO.NET select from view returns empty rowset

    Yan-Hong Huang[MSFT], Oct 15, 2003, in forum: ASP .Net
    Replies:
    12
    Views:
    846
    Yan-Hong Huang[MSFT]
    Oct 23, 2003
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,033
    Smokey Grindel
    Dec 2, 2006
  3. Replies:
    2
    Views:
    724
  4. Srijayanth Sridhar
    Replies:
    19
    Views:
    629
    David A. Black
    Jul 2, 2008
  5. Mario
    Replies:
    1
    Views:
    91
    Grant Wagner
    May 17, 2004
Loading...

Share This Page