Calculating Check Boxes in columns to total at the bottom
I have a page with 12 columns of 31 checkboxes that are to be tabulated at the bottom of each column.
My field structure has the following naming convention:
check1.row check2.row check3.row...
check1.row1 check2.row1 check3.row1...
check1.row2 check2.row2 check3.row2....
...and so on down to row30 (which is the 31st row)
the bottom tabulation row goes like this...
check1.total check2.total check3.total....
I have a code from a recent similar situation I used as a start. I set the bottom total field as the target field. First I get the column names with a split and pop, then I get the array for the column. The loop starts by not adding the target field, and loops through the array to see if the checkbox value is not "Off" which will add one to the value if it counts. This would put the event value in the total. I'm not getting any syntax errors but it's not working.
I'm newer at this. I referenced another solution here for counting checkboxes and adding assorted scores to a total. Obviously there's something I'm missing here.
var aNameParts = event.targetName.split(".");
aNameParts.pop();
var strColName = aNameParts;
var oColFldList = this.getField(strColName);
oColFldList.getArray().forEach(function(a,i)
{if(a != event.target) event.value=Number(i?event.value:0);
if (a.value!="Off") Number+=1;});
