Possible Duplicate:
fetching checkbox multidimensional array in javascript
Is it possible to implement a multidimensional array of checkboxes?
For example
<input type='checkbox' name='question[0][]' value='0'>
<input type='checkbox' name='question[0][]' value='1'>
<input type='checkbox' name='question[0][]' value='2'>
<input type='checkbox' name='question[1][]' value='0'>
<input type='checkbox' name='question[1][]' value='1'>
<input type='checkbox' name='question[1][]' value='2'>
<input type='checkbox' name='question[2][]' value='0'>
<input type='checkbox' name='question[2][]' value='1'>
<input type='checkbox' name='question[2][]' value='2'>
If this is possible how would you pick up whether the checkboxes are checked or not in javascript?
Well it is possible to select a specific checkbox.
You can select on the name attribute
question[x][]then loop through those to get each of their checked values.An example using jQuery:
Or to make it even fancier:
Fiddle: http://jsfiddle.net/maniator/XA8XV/