Select2: How do I stop select2 from auto-selecting the first option in a multiselect?

Created on 28 Oct 2015  路  2Comments  路  Source: select2/select2

I am using a multiselect with a predefined set of options. For some reason, the first one always gets selected by default.

Here's a fiddle: http://jsfiddle.net/o020bybb/1/

Any thoughts?

Most helpful comment

The select itself also needs to be a multi-select:

<select class="js-data-example-ajax" multiple="multiple">
...
</select>

All 2 comments

The select itself also needs to be a multi-select:

<select class="js-data-example-ajax" multiple="multiple">
...
</select>

@Eckankar that does the trick! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FezVrasta picture FezVrasta  路  3Comments

T-Nagui picture T-Nagui  路  3Comments

mauroschiappo picture mauroschiappo  路  3Comments

dereuromark picture dereuromark  路  3Comments

hipertracker picture hipertracker  路  3Comments