dimanche 8 février 2015

Check if any checkbox in form is checked (MooTools)

I'm using a form with various checkbox groups and I would like the next button at the bottom of the page to appear only if any of the checkboxes is checked.


I found a working solution using jQuery here:



var checkboxes = $("input[type='checkbox']"),
submitButt = $("input[type='submit']");

checkboxes.click(function() {
submitButt.attr("disabled", !checkboxes.is(":checked"));
});


http://ift.tt/1DVMEqG


I'm looking for a way to do this with MooTools and I would prefer a solution where the button state is not "disabled" but hidden via CSS.





Aucun commentaire:

Enregistrer un commentaire