mercredi 14 janvier 2015

Check if all checkboxes are checked on submit

I have this:



<fieldset id="booom">
<label><INPUT TYPE="checkbox" NAME="a" VALUE="a">something></label>
<label><INPUT TYPE="checkbox" NAME="b" VALUE="b">something></label>
<label><INPUT TYPE="checkbox" NAME="c" VALUE="c">something></label>
</fieldset>

<input type="button" id="answer" value="submit">


How can I check with jQuery if all checkboxes from fieldset 'booom' are unchecked on submit?


So:



if (all checkboxes from parent 'booom' are unchecked) {
alert("something")
}


I found many posts about this but none with an actual simple working sample with a button and an alert box :)


Thanks!





Aucun commentaire:

Enregistrer un commentaire