By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,166 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,166 IT Pros & Developers. It's quick & easy.

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

P: n/a
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[i] = new Option(list[i][0]);
alert(diktelijst.options[i].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>
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Arjen <ar*****************@nowhere.com> 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[i] = new Option(list[i][0]);

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

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.