[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

jQuery MSDropDown-> Resetting to first option

Posted on 2011-09-08
7
Medium Priority
?
3,588 Views
Last Modified: 2012-05-12
I've found numerous references to setting the first option in the msdropdown using this code:
    var oHandler = $('#input_zip').msDropDown().data("dd");
    if(oHandler) {
      oHandler.set("selectedIndex", 0);
    }

Open in new window


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);

Open in new window

It does essentially the same thing and I still get the error.

Any ideas?
0
Comment
Question by:EddieShipman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 36505875
did you tried this?

$("#input_zip").val($("#input_zip option:first").val());

0
 
LVL 26

Author Comment

by:EddieShipman
ID: 36506125
No, but I will and let you know.
0
 
LVL 26

Author Comment

by:EddieShipman
ID: 36506179
It changes the val() but it does not reset the text.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 total points
ID: 36506213
0
 
LVL 26

Author Comment

by:EddieShipman
ID: 36506626
You DO know that that was my question, don't you?
0
 
LVL 26

Author Comment

by:EddieShipman
ID: 36506666
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.

0
 
LVL 26

Author Closing Comment

by:EddieShipman
ID: 36506667
Thanks for pointing out the obvious to me.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question