Custom Calculation Script Help Please
Hello,
I have no experience with JavaScript. Can someone please help me with a custom calculation for a checkbook register?
Example of Field Names used on each line of the form:
Amt1 Dep1 Bal1
Amt2 Dep2 Bal2
I've tried the following Simplified Field Notation: BalanceForward - Amt1 + Dep1. This works on the first line of the form and then auto populates the balance field on each remaining line of the form. If there are no entries (check or deposit) I don't want to see the balance populated.
I've also tried the following JavaScript with similar results. The below works in the first line (Bal1 field), however when I change the script to reflect different field names it doesn't calculate and returns nothing.
Example of script in Bal1 field:
event.value=Number(this.getField("BalanceForward").value)-Number(this.getField("Amt1").value)+Number(this.getField("Dep1").value);
I think I need an If/Else statement in Bal2, Bal3, Bal4, etc. fields, however I don't know how to write it! If there are no entries in Amt2 or Dep2 then no balance (Bal2 field) should appear.
Thank you!
