mardi 31 août 2021

HTML keep checkbox checked after form submit

I have some checkboxes in my code, that activate input fields after getting checked. For default they are disabled, so that the user chooses, wich input field to activate and so wich filter to activate or not. After the submit of the form the checkbox is always disabled again. Does anybody know how to keep them acitvated after submit, but also make them disabled by default.

<div>
    <input type="checkbox" onclick="var input = document.getElementById('Filter');   if(this.checked){ input.disabled = false; input.focus();}else{input.disabled=true;}" />
    <span class="text-white">Filter</span>
    <input id="Filter" name="Filter" disabled="disabled" />
</div>



Aucun commentaire:

Enregistrer un commentaire