mardi 16 mars 2021

enable disable button on checkbox click jquery

On my page, i have a checkbox and a submit button :

<input type="checkbox" id="chkbxId" />
<input type="submit" name="submit" id="submitId" value="Update" disabled="disabled" />

I would like with JQuery :

  • the user arrives on the page because he wants to activate his settings: the box isn't checked and the button is disabled.

If the user checks the box, the submit button is enabled. If the user unchecks the box, the submit button is disabled.

  • the user arrives on the page because he wants to desactivate his settings: the box is checked and the button is disabled.

If the user unchecks the box, the submit button is enabled. If the user checks the box, the submit button is disabled.

Thank you,




Aucun commentaire:

Enregistrer un commentaire