jeudi 10 novembre 2016

Java Spring MVC form:checkboxes - how to know if any were checked

Say I have the following line in my JSP:

<form:checkboxes path="appliedPlayers" items="${suitablePlayers}" itemValue="id" itemLabel="displayName" />

I would like to disable the form-submit button when none of the checkboxes are checked. Something like:

$('#checkboxes').change(function() { 
    if (none_are_checked)
        disableBtn();
});




Aucun commentaire:

Enregistrer un commentaire