You can loop through the form elements and use a bit of regular expression to get as many checkbox values you want.
Example:
Code:
var myArgs[1] = {};
fucntion Collect(oForm)
{
var e=oForm.elements;
for(var i=0;i<e.length;i++)
{
if(e[i].type="checkbox" && e[i].name.match(/^comments([\d]+)$/))
{
if(e[i].checked)
myArgs[1][RegExp.$1] = 1;
else
myArgs[1][RegExp.$1] = 0;
}
}
//calling the function
Collect(document.forms[0]);
Hope this is useful.
http://spradeep.blogspot.com