vendredi 4 août 2017

toggle required on textfields when checkboxes are checked

I set all my checkboxes checked when any of the checkboxes in a table is clicked. Now I need to set all text fields to required when the checkboxes are checked and remove required when all checkboxes are not checked.

With this code I check all checkboxes. How do I toggle required on the textfields fields?

$('.checkAll').click(function (e) {
    $(this).closest('table').find(':checkbox').prop('checked', this.checked);
})




Aucun commentaire:

Enregistrer un commentaire