The "getArray" function is nifty, but only works in one dimension because of the hierarchical nature of field grouping. However, since you want to add in either direction it is much easier, and more general, to dynamically build the field names. Here's a sample function, it will add either a row or a column, depending in the inputs: // Lets assume that the function already knows how many rows and columns are in the array, // this however could be another input into the function // cRootName is the root name of the fields // nStart is the row or column index that is being summed // bRow , if true, a row is being summed and nStart is a column number, if false, a column is being summed and nStart is a row number function SumRowCol(cRootName, nStart, bRow) { var nEnd = bRow?28:14; var nSum = 0; for(var i=1;i<=nEnd;i++) nSum += Number( this.getField(cRootName + "." + (bRow?i:nStart) + "." + (bRow?nStart:i)).value ); return nSum; }
... View more