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).
try this
var checked = false;
$(function(){
$('#subm').click(function(e){
checkall();
if(!checked){
e.preventDefault();
}
});
$('.roomselect').change(function(e){
checkall();
});
checkall();
});
function checkall()
{
checked = $('.roomselect:checked').length > 0;
$('#subm').prop('disabled',!checked);
}