Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a select multiple menu in Jquery Monile 1.1. I know the default behavior is to show the item(s) selected and the number once you select items(s) and close the menu.

My question is that I would rather always display the first item and the number NOT the selected items. For example, if I have a menu:

<select name="color-choice" id="color-choice" data-mini="true" multiple="multiple" data-native-menu="false" >
   <option>Color Choices</option>
   <option value="red">Red</option>
   <option value="blue">Blue</option>
   <option value="green">Green</option>
</select>

And the user chose red and green, I want the closed menu to read "Color Choices (2)" instead of the default "Red, Blue (2)".

This is to save space, as I have a few menus and would like to dispense with labels, and have the user tell at a glance that a menu is "color choices" and that they chose 2.

Possible?

share|improve this question
1  
There is no option for this, but hacking this into JQM shouldn't be hard. Check the selectmenu plugin, see how plugin options are defined, set your own option (best data-attributable) and in build function, find the text display. instead of displaying the text, check for your new option. if option is defined, use it, otherwise default JQM. –  frequent May 3 '12 at 20:37

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.