0

Is there any way to make select, which allows multiple selections look like ordinary? Like a drop-down, you know…

<select multiple="multiple"></select>

look like

<select></select>

http://jsfiddle.net/UKf5Y/3/

SilentImp
  • 1,865
  • 1
  • 18
  • 28
  • Yes, but you need to implement it yourself in JavaScript. – JJJ Aug 04 '13 at 16:33
  • 1
    But the entire point of a drop-down menu is to be able to choose only one item at a time... – BoltClock Aug 04 '13 at 16:34
  • @BoltClock WHAT? What do you think the `multiple` attribute is for then? – RiggsFolly Aug 04 '13 at 16:43
  • Well … do it without js in a native way was what I want in first place. :) Design give me only 40px height for this element, so I want get dropdown :( Otherway I must use some js workaround. And I don't like it. – SilentImp Aug 04 '13 at 17:25

2 Answers2

3

Well, no. If there were, how would the user use it to select multiple items?

The only way that a multiple selection works is because all of the items are displayed at the same time and they can click-and-drag or click while holding down a modifier key.

If it looked like a drop-down box, how would you navigate to a second item without deselecting the first?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • @SilentImp Additionally, how would it display multiple sections when in its standard state? (That way madness lies, etc.) – John Parker Aug 04 '13 at 16:36
  • It's reasonable to have for example a dropdown with selections that are added to a separate list every time something is chosen from it. The default multiple-select input is pretty unintuitive for most people. – JJJ Aug 04 '13 at 16:37
  • Agreed, @Juhana. I think they're an awful bit of UI and generally look for alternatives. But I don't think picking items on one control and having your selection show up somewhere else is that much better. – Cody Gray - on strike Aug 04 '13 at 16:40
  • Yeah, I'd go with autocomplete for a longer list and plain old checkboxes for a shorter list. – JJJ Aug 04 '13 at 16:42
  • I it not possible — it don't matter how I seeing it … it is how it is :( – SilentImp Aug 04 '13 at 17:30
0

The styling of a select list, as well as many different elements in HTML (notably the input[type='file'] element, is really dependent on the browser. If you're looking to make it visually more appealing / different, you'll really need to use some JavaScript and use an "interface" to your select. Some really nice JavaScript libraries for select lists are jQuery Multiselect, jQuery UI Multiselect and select2, maybe you should look at those.

It's worth noting however that only select2 supports the single/multiple variants, and the styles still do look different, but how else would you be able to see multiple selections at one time? You could design your own solution which did look identical, but I think more than anything this would be misleading.

Ian Clark
  • 9,237
  • 4
  • 32
  • 49