As you may or may not know, adding the "disabled" attribute to an <option> tag in IE does not work. There is a work-around to this using JavaScript that applies a gray-ish style to the option and does not allow the option to be selected, although it can be highlighted.
I am using AJAX to call a PHP page that prints out multiple
that are loaded into a div.
The issue is that the JavaScript work-around for IE doesn't work correctly UNLESS I first use an alert() call. That is, the options marked disabled will still be selectable and not gray, but placing the alert() in the code makes it work as intended.
Has anyone ever run across this issue or something similar to it? Why would a call to alert() be the reason that it works? Does alert() do something special in IE that would affect the javascript or html? Is it even the call to alert() or something else?
The code for the javascript work-around is below:
The disableOptions function is being called after the php is loaded via AJAX. Placing alert("") as the first line of the disableOptions function fixes the issue.
Any comments and advice welcome.
Thanks