How can i get the selected values from the chosen Multi-select Box?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
This worked for me
As of 2016, you can do this more simply than in any of the answers already given:
where "myChosenBox" is the id of the original select input. Or, in the change event:
In the Chosen doc, in the section near the bottom of the page on triggering events, it says "Chosen triggers a number of standard and custom events on the original select field." One of those standard events is the change event, so you can use it in the same way as you would with a standard select input. You don't have to mess around with using Chosen's applied classes as selectors if you don't want to. (For the
change
event, that is. Other events are often a different matter.)Like from any regular input/select/etc...:
If anyone wants to get only the selected value on click to an option, he can do the follow:
this is the right answer, I tried, and the value passed is the values separated by ","