R
Robin Johnson
Hello,
I'm writing some dynamic forms code for running on a PocketPC (running Windows
2003). There is to be a set of select menus, and choosing a particular option
in one menu changes the options available in the next.
In an ordinary select element I can change the text and value of the various
options using
document.forms['myform'].elements.myselect.options.text = 'foo'
document.forms['myform'].elements.myselect.options.value = 'foo_value'
but I can't change the length of the options array: options.length doesn't
seem to accept assignment or the ++ operator (as I'm used to using for IE6 on
a desktop machine), or the method add(). If I can't add (and remove) options
I'll have to resort to a static number of options in the select, and just
blank out the ones I don't want, which I can do but is a bit unmannerly. I'd
appreciate it if anyone can help.
I'm writing some dynamic forms code for running on a PocketPC (running Windows
2003). There is to be a set of select menus, and choosing a particular option
in one menu changes the options available in the next.
In an ordinary select element I can change the text and value of the various
options using
document.forms['myform'].elements.myselect.options.text = 'foo'
document.forms['myform'].elements.myselect.options.value = 'foo_value'
but I can't change the length of the options array: options.length doesn't
seem to accept assignment or the ++ operator (as I'm used to using for IE6 on
a desktop machine), or the method add(). If I can't add (and remove) options
I'll have to resort to a static number of options in the select, and just
blank out the ones I don't want, which I can do but is a bit unmannerly. I'd
appreciate it if anyone can help.