Hi.
I need to dynamically update the contents of a select box. I've written
a script which sucessfully achieves this in firefox, but, surprisingly,
it didn't work in internet explorer. When the page runs in explorer I
get a type mismatch error. This is the bit that generates the error
arr is an array of strings, el is a select object.
for(index in arr) {
opt = new Option(arr[index], arr[index]);
el.add(opt, null); // <--- this line
}
Has anyone come across this before? Any help would be great.
Thanks
I need to dynamically update the contents of a select box. I've written
a script which sucessfully achieves this in firefox, but, surprisingly,
it didn't work in internet explorer. When the page runs in explorer I
get a type mismatch error. This is the bit that generates the error
arr is an array of strings, el is a select object.
for(index in arr) {
opt = new Option(arr[index], arr[index]);
el.add(opt, null); // <--- this line
}
Has anyone come across this before? Any help would be great.
Thanks
Comment