Weird IE Problem Using This Jquery / Javascript
I am using the following code: ieLessThan8OptionDisable = function() { if ($.browser.msie && parseFloat($.browser.version) < 8) { $('select').find('[disabled]').add
Solution 1:
This sounds like a focus issue. The select box has focus when you select a new option, then you pop up an alert which steals focus away from the select element. IE should be closing the select box automatically when the alert gets called but alas they probably didn't test this edge case. So the two clicks do the following:
- Return focus to the select element
- Select an item in the list
Add a call to blur before you invoke the alert:
if (disabled) {
this.blur();// add in
alert("This option is disabled.\nSelect will be set to the first option.");
$(this).find("option:first").attr("selected","selected");
}
PS - I haven't actually tested this, I don't have IE available right now
Post a Comment for "Weird IE Problem Using This Jquery / Javascript"