Eddie Shipman
asked on
jQuery MSDropDown-> Resetting to first option
I've found numerous references to setting the first option in the msdropdown using this code:
Now, in IE8, I'm seeing a problem with this as I get the "A script on this page is causing Internet Explorer to run slowly..." error dialog when executing the first line.
I know it's the code above causing it because I've added breakpoints to see. If I use this code:
Any ideas?
var oHandler = $('#input_zip').msDropDown().data("dd");
if(oHandler) {
oHandler.set("selectedIndex", 0);
}
Now, in IE8, I'm seeing a problem with this as I get the "A script on this page is causing Internet Explorer to run slowly..." error dialog when executing the first line.
I know it's the code above causing it because I've added breakpoints to see. If I use this code:
$('#input_zip').msDropDown().setValueByIndex ("selectedIndex", 0);
It does essentially the same thing and I still get the error.Any ideas?
ASKER
No, but I will and let you know.
ASKER
It changes the val() but it does not reset the text.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You DO know that that was my question, don't you?
ASKER
While I accepted that post as the answer in the other question, I did not try the code. I used the code in the last post.
If I'd used the code in the accepted solution, my troubles would have been over.
If I'd used the code in the accepted solution, my troubles would have been over.
ASKER
Thanks for pointing out the obvious to me.
$("#input_zip").val($("#in