6

I am using bootstrap select plugin with bootstrap 3.0.2, which fulfils most of my requirements.
The only additional functionality I want is to be able to select an optgroup by clicking it.

For example I would like to select Picnic (picture below) just like any other option, enter image description here

Bootsrap select page

ArtOfCode
  • 5,702
  • 5
  • 37
  • 56
Antonis
  • 361
  • 2
  • 4
  • 11

1 Answers1

4

This has little to do with Bootstrap. optgroups in HTML are not designed to selected. My suggestion would be to drop them all together and just make them normal options with a class and style them differently. However keep in mind, that many browsers are limited to how you can style options, so make sure you test this in multiple browsers.

RoToRa
  • 37,635
  • 12
  • 69
  • 105
  • This is not practical. Thinking about have to select 500 items from 2000, for example. – Khrys Nov 13 '15 at 02:32
  • @Khrys I'm not quite sure what that has to do with the original question, but I'd suggest using checkboxes. – RoToRa Nov 13 '15 at 14:02
  • It has everything to do with the topic. The Bootstrap Select has a workaround for this: https://github.com/silviomoreto/bootstrap-select/issues/1159#issuecomment-153998138 The owner are studing to implement this. – Khrys Nov 13 '15 at 16:36