1
0
mirror of synced 2024-11-26 23:06:02 +03:00
select2/pages/03.appearance/01.markup/docs.md
2017-09-02 20:34:47 -04:00

3.3 KiB

title taxonomy process never_cache_twig
Basic markup
category
docs
twig
true
true

A standard <select> box contains any number of <option> elements. Each of these is rendered as an option in the dropdown menu. Select2 preserves this behavior when initialized on a <select> element that contains <option> elements.

Disabling a Select2 control

Select2 will respond to the disabled attribute on <select> elements. You can also initialize Select2 with disabled: true to get the same effect.

Enable Disable


Labels

You can, and should, use a <label> with Select2, just like any other <select> element.

<label for="id_label_single">
  Click this to highlight the single select element

  <select class="js-example-basic-single js-states form-control" id="id_label_single"></select>
</label>

<label for="id_label_multiple">
  Click this to highlight the multiple select element

  <select class="js-example-basic-multiple js-states form-control" id="id_label_multiple" multiple="multiple"></select>
</label>