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).
i suggest you to use "button" instead of "submit".
please follow this
HTML->
$(function(){
$("#submit").click(function(e){ var number_of_checked_checkbox= $("input[name=q]:checked").length; if(number_of_checked_checkbox==0){ alert("select any one"); }else{ $("#booking").submit(); } }); });