1var values=[];
2$('input[name="your-checkbox-name[]"]:checked').each(function () {
3 values[values.length] = (this.checked ? $(this).val() : "");
4});
1<form id="form1" action="/controller/action" method="post">
2 <input type="checkbox" name="box1" class="cBox" />
3 <input type="checkbox" name="box2" class="cBox" />
4 <input type="checkbox" name="box3" class="cBox" />
5 <input type="submit" value="Submit" />
6</form>
7<script>
8$('#form1').submit(function() {
9 if ($('input:checkbox', this).length == $('input:checked', this).length ) {
10 // everything's fine...
11 } else {
12 alert('Please tick all checkboxes!');
13 return false;
14 }
15});
16</script>
1 $('#checkAll').click(function () {
2 $('input:checkbox').prop('checked', this.checked);
3 });