1
I have a field in which to activate the checkebox
, he disables the input
, but when I reload the page checkebox
is disabled, so having to turn it back on.
function desabilitar(selecionado) {
document.getElementById('tel').disabled = selecionado;
}
<div class="form-group">
<label for="NomeEscola" style="font-weight: normal">Telefone Residencial:
<input type="checkbox" onclick="desabilitar(this.checked)"/> 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>
</div>
You want that when loading the page the checkbox is already marked and the field disabled?
– Daniel Mendes
So if I mark it, then reload the page then it should remain marked, the same unlike
– Paulo Junior
You can do it using localStorage: https://developer.mozilla.org/en-US/docs/Web/API/Window/Window.localStorage
– LeAndrade
and failed to complete his question?
– novic
Another thing, it disables 1 imput, as it would when you check the checkbox, disable more than one?
– Paulo Junior