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

Javascript - Calculating taxes

New Here ,
Feb 27, 2020 Feb 27, 2020

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);
TOPICS
General troubleshooting , PDF forms
801
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
LEGEND ,
Feb 27, 2020 Feb 27, 2020

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

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 ,
Feb 27, 2020 Feb 27, 2020

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

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 ,
Mar 03, 2020 Mar 03, 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

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 ,
Feb 27, 2020 Feb 27, 2020

 PDFElement is not a Adobe product.

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 ,
Mar 03, 2020 Mar 03, 2020

Hi All, 

 

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

Thank you

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 ,
Mar 03, 2020 Mar 03, 2020
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 ,
Mar 03, 2020 Mar 03, 2020

Adobe never had such a product, as far as I'm aware.

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 ,
Mar 03, 2020 Mar 03, 2020
LATEST

Ok thanks.  Ill transfer it to adobe then reach back out.

Thank you for the information

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