Enable select2 multi-select search box

select2 v4.0.3

<select class="smartsearch_keyword" name="keyword[]" id="keyword" style="width:100%;"></select>

$(".smartsearch_keyword").select2({
    multiple: true,
    ...
});

In addition: to set multiple default selections


The answer is that the select2 input element becomes the search box for multiple selects without back end data

if you start typing , your results will start filtering the options

if you have it set to load remote ajax data, it actually does retain a search box, but for multiple selects without a data source, the input is the search bar, which is fairly intuitive

https://select2.github.io/examples.html