Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there a way to create a drop down menu similar to that of a select button?

 
Toni Howlett
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on a site that needs to work on both desktop and mobile devices and i'm trying to add a drop down to multiple sections of my settings page. I want the user to be able to click it, and a list appears where they can select stuff like delete, add to group, add to new group and possibly a few other things.

A select tag would work perfectly if the shown text didn't change when you clicked on it. (I like select because on mobile - at least my android - it brings up a list on half the screen thats easy for the user to click).

Is there a way to attach functions to the select-list objects and then have the text shown on the select button go back to default?

Or is there a different kind of menu all together that accomplishes this.


I'm using jQuery/jQueryMobile



Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, bind a change handler that sets the value of the control to your "default" value.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic