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
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
Share Improve this question edited Jun 22, 2016 at 13:37 Sunil Pachlangia asked Jun 22, 2016 at 13:19 Sunil PachlangiaSunil Pachlangia 2,0613 gold badges17 silver badges26 bronze badges 7-
1
Can you replicate it in
snippet
orfiddle
? – Guruprasad J Rao Commented Jun 22, 2016 at 13:20 - To me works fine, look at this: jsfiddle/40eemy84/9 – Teuta Koraqi Commented Jun 22, 2016 at 13:27
- @TeutaKoraqi Works for me as well except searchbox – Sunil Pachlangia Commented Jun 22, 2016 at 13:29
- Can you provide a fiddle? – Teuta Koraqi Commented Jun 22, 2016 at 13:30
- @TeutaKoraqi I am using this in Bootstrap modal div in which i load a HTML page – Sunil Pachlangia Commented Jun 22, 2016 at 13:36
1 Answer
Reset to default 16Your code looks ok: https://jsfiddle/3tfjn9zb/1/
Are you using it in a bootstrap modal? If so: try to remove tabindex="-1"
from the modal div.