Skip to main content
Known Participant
February 27, 2020
Question

Javascript - Calculating taxes

  • February 27, 2020
  • 4 replies
  • 892 views

Hi,

Im trying to create a PDFElement form that will calculate taxes only for either PA(1.06%) or Philadelphia, PA (1.08%), PA; not for MD or DE. I have a combo drop down box that I am trying to link it to. I cant figure out how to add the city part (a text box) into the equation.  This is what I have so far, but I am totally new, so it might be all wrong.

 

var fTaxRate; // variable for tax rate
switch(this.getField('Combo Box1').value) {
case 'PA': // Pensylvania
fTaxRate = 0.0106; // tax rate for this state
break; // skip the rest of the test 
case 'DE': // Delaware
case 'MD': // Maryland
default: // all other states
fTaxRate = 0;
} // end switch
 // compute tax rate times the sum of subtotal 1event.value = fTaxRate * (this.getField('Text Box45').value);
This topic has been closed for replies.

4 replies

Known Participant
March 3, 2020

Hi All, 

 

I thought PDFElement was apart of Adobe?  Am I wrong?

Thank you

Bernd Alheit
Community Expert
Community Expert
March 3, 2020
Bernd Alheit
Community Expert
Community Expert
February 27, 2020

 PDFElement is not a Adobe product.

try67
Community Expert
Community Expert
February 27, 2020

Assuming this is indeed a PDF file, you didn't really explain how the city value comes into play in the calculation...

Known Participant
March 3, 2020

Hi,

Should I add 

case 'Philadelphia': // Philapelphia
case 'PA': // Pensylvania
fTaxRate = 0.0108; // tax rate for this city

 

Sorry completely new.  This is a PDF file.  I thought Adobe owned PDFElement.  Ill have to research that more.

Thank you

Legend
February 27, 2020

What is a PDFElement form? This forum is for questions about Adobe products....