I have 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'm using this function to be able 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 solve it? Thank you.