The option which is specified as 'selected' is not ... selected... in IE6/win : the first option gets selected instead.
This patch fixes this - tested on IE6 and FF 1.5 on WinXP.
I haven't tested for a multiple select, though
IE DHTML implementation behaves really strangely when it comes to selected options in a select...
I spent about an hour trying various code combinations before finding this one that works.
Believe it or not, removing the 'option.innerHTML = text;' line breaks the display.
Small drawback (seen on IE, not on FF) :
When the select is updated, there is a short flickering where the first option is briefly displayed before the proper option gets "selected"
That's the best I could come up with right now, though...
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | activeselect.js_1.patch | 994 bytes | Jaza |
| activeselect.js_0.patch | 1.1 KB | yched |
Comments
Comment #1
Jaza commentedI gave activeselect a thorough test run, to see if I could find the problem you're reporting. The problem only exists for single-selects, not for multi-selects. I tried out your patch, but instead of fixing the problem, it just made things worse. It seemed to get rid of any '
<none>' options that I had, and so was causing the lists to get populated wrongly.The solution that I found was to set the selectedIndex attribute of the select element, if it is a single-select. IE needs this to be set correctly, but FF doesn't (FF doesn't mind if it's there, though). I've attached the patch that I applied, so you can see the solution.
Comment #2
(not verified) commented