Colleagues.
I have a field that I need to enable and disable when I click on a checked. See:
WhenIclickchecked,Icandisableit,butwhenIuncheckit,thefieldisstilldisabled.I'mdoingitthisway:
JAVASCRIPT
<scripttype="text/javascript">
function desabilitar(valor){
if(valor == 'sim'){
document.getElementById('tel').disabled = true;
}else{
document.getElementById('tel').disabled = false;
}
}
</script>
HTML
<div class="form-group">
<label for="NomeEscola" style="font-weight: normal">Telefone Residencial:
<input type="checkbox" onclick="desabilitar('sim')"> O mesmo do aluno</label>
<div class="input-group">
<div class="input-group-addon" style="background-color: #FAFAFA">
<i class="fa fa-arrow-circle-right" aria-hidden="true"></i>
</div>
<input type="text" class="form-control" name="TelefoneResidencial" id="tel" data-inputmask="'alias': '(99)9999-9999'" maxlength="150">
</div>