angrytuna
05-16-2003, 12:52 PM
I've written a function that finds a particular SELECT form element in form "myform":
s = document.myform.elements[0]
//<Object SELECT>
grabs its list of options, changes the length
s.options.length = (some number)
iterates through the list, and assignes values to the innerHTML of that particular option.
for(i=0;i<s.options.length;i++){
s.options[i].innerHTML = "some text";
}
This works like a champ on everything except IE for OSX. This will COMPLETELY and INDEFINITELY hang the browser, forcing you to kill the running browser process.
Does anyone have an idea as to why this is? Can anyone think of another way to change the size and visible text of a select list with javascript?
Thanks in advance.
~AT
s = document.myform.elements[0]
//<Object SELECT>
grabs its list of options, changes the length
s.options.length = (some number)
iterates through the list, and assignes values to the innerHTML of that particular option.
for(i=0;i<s.options.length;i++){
s.options[i].innerHTML = "some text";
}
This works like a champ on everything except IE for OSX. This will COMPLETELY and INDEFINITELY hang the browser, forcing you to kill the running browser process.
Does anyone have an idea as to why this is? Can anyone think of another way to change the size and visible text of a select list with javascript?
Thanks in advance.
~AT