0
How can I start a selectbox of type Select2 with the first option selected as disabled?
HTML:
<div class="form-group">
<select name="tipoOperacao" id="tipoOperacao" class="selectTipo2" style="min-width : 100%">
<option value="0" selected disabled>Selecionar...</option>
</select>
</div>
JAVASCRIPT:
$(".selectTipo2").select2();
What happens is that with the disabled property in the option, it does not appear to me selected:
I’ve tried the following option and it doesn’t work either:
<option value="0" selected="selected" disabled="disabled">Selecionar...</option>
How do I mount a Select2 with the first option disabled?