Dynamic listbox

V

Vik

I need to add/remove the items to/from the dropdownlists/listboxes on an
..aspx page. I tried the following code in JavaScript:
document.getElementById("ListBox1").add(new Option("5","5"));
The code adds the new item for a moment (I can see it in the listbox and can
retrieve it by the code) but then the new item disappears from the listbox.

How can I fix it?

Thanks.
 

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

Forum statistics

Threads
474,266
Messages
2,571,075
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top