Well, you can select a specific checkbox.
You can select the name question[x][] attribute question[x][] , and then loop through those to get each of their verified values.
An example of using jQuery:
var checkedBoxes = {0: [], 1: [], 2: []}; $("input[name='question[0][]']").each(function(){ checkedBoxes[0].push(this.checked); }); //then do the same for 1 and 2 //after everything: console.log(checkedBoxes); //a multidimesional array of checked boxes
Or make it even more attractive:
var checkedBoxes = {0: [], 1: [], 2: []}; for(index in checkedBoxes) { $("input[name='question[" + index + "][]']").each(function(){ checkedBoxes[index].push(this.checked); }); } //after everything: console.log(checkedBoxes); //a multidimesional array of checked boxes
Fiddle: http://jsfiddle.net/maniator/XA8XV/
source share