How can I start a selectbox of type select2 with the first option selected 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 selected to me:
Ihavetriedthefollowingoptionanditalsodoesnotwork:
<optionvalue="0" selected="selected" disabled="disabled">Selecionar...</option>
How do I mount a select2 with the first option disabled?