Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > dynamic select: query value option in IE6 returns empty, mozillaoke why

Reply
Thread Tools

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

 
 
Arjen
Guest
Posts: n/a
 
      06-26-2004
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>
 
Reply With Quote
 
 
 
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      06-26-2004
Arjen <(E-Mail Removed)> 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 - http://www.velocityreviews.com/forums/(E-Mail Removed)
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Build dynamic sql query for JSTL <sql:query> Anonymous Java 0 10-13-2005 10:01 PM
how to render an option value dynamic ! Gianni Javascript 9 07-15-2004 07:39 PM
adding value to dynamic option Dave Anderson Javascript 0 03-04-2004 08:53 PM



Advertisments