Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom calculation

New Here ,
Nov 03, 2021 Nov 03, 2021

Hi, I would like to add a custm calculation in my tax box. 

I want the user to check off either of the following: 

No tax

13% tax

15% tax

Once checked, I want the percentage amount to calculate with the subtal.

 

What would be my script?

 

Capture.JPG

TOPICS
How to , PDF forms
294
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2021 Nov 03, 2021

As custom calculation of tax field use this:

var notax = this.getField("taxnone").value;
var t13 = this.getField("tax13").value;
var t15 = this.getField("tax15").value;
var sub = Number(this.getField("subtotal").value);
if(notax != "Off")
event.value = 0;
else if(t13 != "Off")
event.value = .13*sub;
else if(t15 != "Off")
event.value = .15*sub;
else event.value = "";

 

Check if field names are correct, if not, change them to your actual field names.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2021 Nov 03, 2021
LATEST

Thank you very much for your time!!! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines