Copy link to clipboard
Copied
I am working on a fillable form for a cemetery. If you look at the attachment the two fields on the right are usually calculated with tax which I create a formula for to register in the Sales Tax box. However, after I completed the form the cemetery owner informed me that some items in those two categories are not taxable but she was unable to override the calculated amount.
The existing formula is (Amount3+Amount4)*.06 which is displated in Amount7 I was thinking that I could change block 7 (which is to the left of Sales Tax) to a drop down with Yes or No. But then I need a formula that would look to block 7 and if it is checked No then it would register as $0.00 in the Amount7 (Sales Tax) field, otherwise it would report the 6% sales tax.
Thank for any help.
If this is what you had in mind add this code to Amount7 field "Custom Calculation Script"
var a = this.getField("Amount3").value;
var b = this.getField("Amount4").value;
var c = this.getField("Dropdown").value;
if(c == "No"){event.value = "$0.00";
}else event.value = (a+b)*.06;
Copy link to clipboard
Copied
If this is what you had in mind add this code to Amount7 field "Custom Calculation Script"
var a = this.getField("Amount3").value;
var b = this.getField("Amount4").value;
var c = this.getField("Dropdown").value;
if(c == "No"){event.value = "$0.00";
}else event.value = (a+b)*.06;
Copy link to clipboard
Copied
A small note: It's better not to include the currency symbol when applying the value. Just use 0 or even "0", and let the Format setting of the field add the currency symbol. Otherwise you won't be able to set it up as a Number field and use it in other calculations.