i\'m triyng to validate a form. In this form you\'ve to choose at least one element by checkboxes, and I can\'t be sure about their quantity (it depends by elements number).
The :checked selector will Match all elements that are checked or selected.
You could try this
$("#subm").click(function(e){ if($(".roomselect:checked").length == 0){ e.preventDefault(); } });