7
I own these HTML fields:
<div class="col-sm-6">
<input asp-for="ConfiguracaoTecnibra.HabilitaTeclado" type="checkbox" id="cbHabilitarTeclado" onclick="HTeclado();" />
<label class="control-label">Biometria</label>
</div>
<div class="col-sm-6">
<label asp-for="ConfiguracaoTecnibra.SentidoTeclado" class="control-label"></label>
<select asp-for="ConfiguracaoTecnibra.SentidoTeclado" id="cbSentidoTeclado" class="form-control">
<option value="I">Irrelevante</option>
<option value="E">Entrada</option>
<option value="S">Saída</option>
</select>
</div>
I am using this function to block the field, but it does not work:
function HTeclado() {
document.getElementById('cbSentidoTeclado').disabled = false;
if ($("#cbHabilitarTeclado").prop('checked') == true) {
$("#cbSentidoTeclado").prop("disabled", true);
}
else {
$("#cbSentidoTeclado").prop("disabled", false);
}
}
That way it’s not working, how can I fix it? Thank you.
Is mixing Vanilla with jQuery pq?
– LeAndrade
I’ve tried my best, I’ve tried my best.
– Mariana
You who disable select by clicking the checkbox is this?
– LeAndrade
If true enables, if false disables.
– Mariana
Quote the disabled value
– Gabriel Fernandes
@Gabrielfernandes did not understand.
– Mariana