Answered
I need to calculate a total using one of three variables.
My Example:
Membership A: $565
Membership B: Calculated Field [i]b_total[/i]
Membership C: Calculated Field [i]c_total[/i]
Donate to Cause 1: Entered Amount [i]don_1[/i]
Donate to Cause 2: Entered Amount [i]don_2[/i]
Total: Calculated Amount
Only one membership total can be used.
If b_total and c_total are "0", I need the total to be (565 + don_1 + don_2)
If there is a value greater than 0 in Membership B:
the total will be (b_total + don_1 + don_2)
If there is a value greater than 0 in Membership C:
the total will be (c_total + don_1 + don_2)
I tried:
var b_total = +getField("StaffBTotal").value; var c_total = +getField("StaffCTotal").value; var don_1 = +getField("IIARF").value; var don_2 = +getField("IIAAF").value; if (b_total !== 0) { event.value = b_total + don_1 + don_2; } else if (c_total !== 0) { event.value = c_total + don_1 + don_2; } else { event.value = 565 +don_1 + don_2; }
What did I do wrong?
George