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

A

Arjen

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>
 
L

Lasse Reichstein Nielsen

Arjen said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top