?
Solved

jQuery MSDropDown-> Resetting to first option

Posted on 2011-09-08
7
Medium Priority
?
3,559 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
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
Course of the Month13 days, 3 hours left to enroll

777 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