Skip to main content
bryans16389082
Inspiring
August 28, 2022
Question

Help with Drop down Tax script

  • August 28, 2022
  • 1 reply
  • 730 views

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.

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
August 28, 2022

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

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

bryans16389082
Inspiring
August 28, 2022

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;

Nesa Nurani
Community Expert
Community Expert
August 28, 2022

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.