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

Tax Calculations

New Here ,
Sep 13, 2024 Sep 13, 2024

Copy link to clipboard

Copied

I'm trying to create a form that will calculate tax on the lines that are marked "taxable". I want to add checkboxes for taxable (Y/N), but I don't know how to create the script to calculate tax on only "Y" marked lines.

robert_0803_0-1726259145250.png

 

TOPICS
PDF , PDF forms

Views

177

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Sep 13, 2024 Sep 13, 2024

First, rename field Text95 to Text94 and change the Subtotal calculation to reflect this change.  Name your check boxes Tax87 through Tax94 (one for each row to match the corresponding Text87-Text94 subtotal fields).  Enter the following custom calculation script in the Tax field:

var tax=0;
for(var i=87;i<95;i++)
{
var rate=this.getField("Tax"+i).value=="Off"?0:0.0875;
tax+=Number(this.getField("Text"+i).value*rate)
}

event.value=tax;

 

Votes

Translate

Translate
New Here ,
Sep 13, 2024 Sep 13, 2024

Copy link to clipboard

Copied

 

Votes

Translate

Translate

Report

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 ,
Sep 13, 2024 Sep 13, 2024

Copy link to clipboard

Copied

LATEST

First, rename field Text95 to Text94 and change the Subtotal calculation to reflect this change.  Name your check boxes Tax87 through Tax94 (one for each row to match the corresponding Text87-Text94 subtotal fields).  Enter the following custom calculation script in the Tax field:

var tax=0;
for(var i=87;i<95;i++)
{
var rate=this.getField("Tax"+i).value=="Off"?0:0.0875;
tax+=Number(this.getField("Text"+i).value*rate)
}

event.value=tax;

 

Votes

Translate

Translate

Report

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