Sunil Pachlangia
Sunil Pachlangia

Reputation: 2061

Select2 default search box not working

I am using select2 js I am just using default function, but the default search box is showing in disabled mode. i am not able to type anything in it.

My code is

<select id="type" name="type" class="form-control select2-use">
    <option value="">select type</option>
    <option value="U">User</option>
    <option value="A">Admin</option>
</select>

$('.select2-use').select2({
    placeholder: "Select",
    allowClear: true
});

I have included the select2.min.css and select2.min.js in my HTML page.

There is no js errors.

I am using this in Bootstrap modal div in which i load a HTML page

Upvotes: 0

Views: 10512

Answers (1)

Devestel
Devestel

Reputation: 221

Your code looks ok: https://jsfiddle.net/3tfjn9zb/1/

Are you using it in a bootstrap modal? If so: try to remove tabindex="-1" from the modal div.

Upvotes: 16

Related Questions