Subject: | return to select list to change options doesn't work |
There is a select list and some options:
<select id="myselect" ...>
</select>
I want to set/unset the:
<option ... />
...
<option ... />
So I give this "option" string back to CGI::Ajax. Firefox changed the
innerHTML of "myselsct" and it works. But the InternetExplorer doesn't
do this. I can't see the options then.
***
This is the way for InternetExplorer AND!!! Firefox:
delete old options:
document.getElementById('myselect').removeChild
(document.getElementsByTagName('myselect')[index]);
add a new options:
var index = null;
if (document.all) index = document.getElementById('myselect').length;
var newEntry = document.createElement('option');
document.getElementById('myselect').add(newEntry, index);