Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Selectmenu does not reflect script changes to select menu (changing selected item)! #270

brunis opened this Issue · 15 comments

2 participants


Demo using setTimeout to change selected item in first dropdown after 1 second. Selected Item is changed but selectmenu is not registering it!


Please take a look at the wiki how to set value and index correct.


Please understand that selectmenu() does not register onchange event, the examples on the wiki do not work.

If i change the underlying select, i would expect selectmenu() to register it, regardless of how it was changed, script, mouseclick or divine intervention!

[edit]Also one thing to notice is that the selected item actually changes in the list! Just not the one visible[/edit]


Adding a change EventListener does not poll constantly and is the foundation of DOM events.

Either i'm not explaining myself correctly or you are misunderstanding my explanation. Let me rephrase:

The SelectMenu (your ui widget), correctly changes the selected item according with my script changes to the original html .. it's just not showing it without opening it.


It wont work, try for yourself.

I talked to Jörn and Scott from jQuery UI a few month ago and we even will not implement it in the official Selectmenu.


I just checked my notes. Jörn said its not possible because we have no propertychange events consistency across the browsers. So we need to pull manually (setIntervall, timeout) in order to make this work.

Hope thats helps to make this more clear.


Yes, that explains it alot better than the wiki.

Could you add to the wiki that it doesn't work with scripts and events then?

And remove this example (since it has no effect):
change: function(e, object){


Ok, i'll try again, since i'm positive that it can work regardless of your notes and whoever! if i could attach a screenshot i could show you that it works already, you just need to update the text in the span ..

  1. Go to this page:
  2. Wait 1 second
  3. Open the first "default popup" dropdown.
  4. Notice that the selected item has changed by my script, as expected!
  5. Realize that you already succesfully register the onchange event of the underlying select!
  6. Realize that you just forget to update the text in Slow
  7. Fix the bug! Please!

I could add a hint. What do you think of?

Wait a second. Your code snippet should work. Please test

Please understand that I maintain this code but Im not the original developer and a bunch of people contributed to this code. Its not really straight forward and Im not aware of all parts of the code ;-)

Im not really register a onChange event, the option text of the selectmenu is only correct because I get it from the current selected, native option. Its more a bug than a feature :-)
Im sorry, as long we do not have a way to register a cross browser onChange event its not possible. Why not using the API (see my example above)?


Thx for the tips, but you're just re-suggesting what's on the wiki and it doesn't work ..

Changing the select with a script does NOT fire the change event!

I'll have a look at the code if i get the time, this is certainly getting us nowhere!

Thanks for trying Felix!


Changing the native select does not work.. And it will never do. Thats what I said multiple times.

What I suggested (and you already posted) does work for sure, just see my fiddle:


i did, it doesn't .. here's my version with the script changing the selected item

notice when you open it, it changed the value for you .. but no alerts !


It wont work when changing the native select. How often should I repeat this sentence?

Problem is the provided method wont do the trick either:
Ive pushed a fix, please download latest commit and give feedback!


You wont have to repeat it again, if you manage to fix that bug.

I can't wait to see if this fixes things for me!

[edit]Sorry, still a nogo, if this always uses latest version from GitHub? that can be your unit test, dropdown should change to Faster when it works :) You're changing the selected item, so you know it works! You just have to update the label on the selectmenu! [/edit]


Yes, its updated every 15min.

jsfiddle /715 still changes the native select. That will not work.
Im not able to fire the change callback event as Im not able to track the change event on the native select. Just changing the text does not make it work. See here again: #270 (comment)

Please debug it yourself if you wont believe.

@fnagel fnagel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.