Creating Custom JavaScript Calculation
Hello,
I am having a difficult time calculating the total of multiple fields and having that total display in the total field. The form I am working on has the ability to spawn a new page as well, the image below is a spawned page.

I've tried using the following code as a custom calculation but no matter what I do the CurrencyTotal field remains blank.
//define strPrefix
var strPrefix = "";
var aFieldName = event.targetName.split(".");
If(aFieldName.length > 2); {
strPreFix = aFieldName[0] + "." + aFieldName[1] + ".";}
//give each field a temp name and bring in its value
var nA = this.getField(strPrefix + "Hundreds").value;
var nB = this.getField(strPrefix + "Fifties").value;
var nC = this.getField(strPrefix + "Twenties").value;
var nD = this.getField(strPrefix + "Tens").value;
var nE = this.getField(strPrefix + "Fives").value;
var nF = this.getField(strPrefix + "Twos").value;
var nG = this.getField(strPrefix + "Ones").value;
//perform calc
var nSum = nA + nB + nC + nD + nE + nF + nG;
//assign total to correct field
event.value = nSum;
Any help is greatly appreciated!!
Thanks in advance! 🙂

