Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select multiple options and still have a dropdown

Status
Not open for further replies.

bean1234

Technical User
Nov 14, 2006
45
US
Hello Experts,

I have a scenario where I need to let the users select multiple values from a dropdown and still have a dropdown becuase in HTML when you set the multiple attribute to 'true' you have to specify the size of the select tag and if you dont specify the size we have a select tag with the default size 1 with out a dropdown.

Is it possible to have adropdown with multiple select option , is there a workaround for this.

Thanks in advance!
 
bean1234, unfortunately there is no built in windows control with this functionality. The only way to be able to select multiple items from a pulldown is to give it the "multiple" attribute.

However, you could build your own custom object using a hidden div for the dropdown, and anchors w/in the hidden div as your selectable objects. I imagine there is likely a downloadable script on google somewhere that is similar to this if you don't want to re-invent the wheel.

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
Thanks Kaht!

I kinda thought so , but I wanted to double check here to see if I have an option.Thanks anyways.
 
You can - as kaht said - roll your own control to handle this sort of functionality. But you run the risk of making life hard for the user. Users expect to be able to select one-and-only-one option from a drop down list, and more than one option from a multi-select list. Trying to provide a control that offers multiple selections from a drop-down list runs you into the territory of setting up custom check-boxes that act like radio buttons or vice-versa. Your controls don't act the way that the user expects them to and interrupts their usage of your application while they have to learn a new control.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Enable Apps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top