Hi, I’m running into an apparent problem with Firefox. I’m trying to use javascript to modify options. It appears to be perfectly functional in IE. In Firefox however it doesn’t allow me to select anything except the first modified option and any options that didn’t get modified.
[code]<html>
<head>
<title>Test Stuff</title>
<SCRIPT>
function calc()
{
document.forms[‘testform’].testselect.options[0] = new Option(“value1″,”1”);
document.forms[‘testform’].testselect.options[1] = new Option(“value2″,”2″);
}
</SCRIPT>
</head>
<body onload=calc()>
<hr>
<form name=”testform” onchange=calc()>
<select name=”testselect”>
<option value=”first”>first option</option>
<option value=”second”>second option</option>
<option value=”third”>third option</option>
</select>
</form>
</body>
</html>
In this example, it will not allow me to select “value2”. What am I doing wrong?
Also, I’m trying to use this method to speed up calculations in IE. My form right now has a very large number of hidden selects that appear/disappear when an option is selected. I’m trying to get “new Option” to work so that it only uses one select which changes into a very large number of different options. If that makes sense – my question is, which method is likely to run faster in IE? I’m only concerned with the time it takes to make the calculations.