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

Help with Drop down Tax script

Explorer ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

I have a drop down box on my form that has all the state abbreviations, I do not know how to get the form to only charge Sales tax on FL only from the drop box.

 

Thank You for any help.

TOPICS
Create PDFs , JavaScript , PDF forms

Views

391

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 ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

var st = this.getField("Dropdown").valueAsString;

if(st == "FL")//put your tax calculation here

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
Explorer ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

The code below worked in form the tax wasn't working on mobile version of adobe reader. Is there a better or different way to write this so it works on mobile to? I am new to this!

 

var st = this.getField("State").valueAsString;
var sub = Number(this.getField("Subtotal").valueAsString);
var dis = Number(this.getField("Discounts").valueAsString);
var ship = Number(this.getField("Shipping").valueAsString);
var total = 0;
if(st == "FL")
total = (sub+dis+ship)*(.07)
else
total = 0;
event.value = total;

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 ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

JavaScript is not fully supported on mobile, so script won't work there.

If you have iOS device, you can try using 'PDF Expert' app by Readdle.

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
Explorer ,
Aug 28, 2022 Aug 28, 2022

Copy link to clipboard

Copied

LATEST

Ok entire sheet works on android with reader just not sales tax code thought it was something I did wrong.

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