Problem with dynamic combo boxes

  • Thread starter Andreas Wohlhaupter
  • Start date
A

Andreas Wohlhaupter

Hi all,
I have an HTML form with an OPTION tag and one SELECT field in it
(value 0, text "none"). I want to fill the other options dynamically
with javascript.

Creating all the options with doc.createElement('OPTION') and setting
the value and innerText properties works fine. But when I want to set
the number of the option-field, that should be selected, this doesn´t
alway work:
o.value = unescape (arr[field])
(where o is my select field)

o.value is still 0 after this assignment. But if I put in an alert
into the line before, it works. It seems, that the IE hasn´t filled
all the option fields until that moment, i make my assignment.

Is there any possibility to find out, whether the IE has finished
creating all the elements? Some kind of readystate attribute as it
exists for whole documents?

Thanks a lot.

Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top