aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Is there a way to create a drop down menu similar to that of a select button? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Is there a way to create a drop down menu similar to that of a select button?" Watch "Is there a way to create a drop down menu similar to that of a select button?" New topic
Author

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

Toni Howlett
Ranch Hand

Joined: Jan 18, 2012
Posts: 35
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

Joined: Jan 10, 2002
Posts: 61768
    
  67

Sure, bind a change handler that sets the value of the control to your "default" value.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a way to create a drop down menu similar to that of a select button?