Skip to main content
Participating Frequently
November 12, 2021
Question

Percentages VS Fixed $ amounts

  • November 12, 2021
  • 2 replies
  • 1736 views

I am using this script it works great for percentages

event.value = this.getField("DiscountName").value * this.getField("Retail").value / 100.0;

I put a value on the dropdown boxes example 10 for "Promotion1" does 10%
What is was wondering if anyone knows how I could have "Promotion2" be a fixed $1000 off.

Then have "Promotion1" stay with a percentage.

This topic has been closed for replies.

2 replies

JR_6739Author
Participating Frequently
November 12, 2021

So the discount dropdown box for website is set to a discount percentage of 10%
I was trying to set that as a fixed amount let's say $1000 

 

When changing to another promotion from the drop down box I was wanting that to be set to a 10% discount. 

 

In the screenshot it shows how this looks.

Thom Parker
Community Expert
Community Expert
November 12, 2021

Ok, so you have this PDF form with a dropdown that lists a number of promotions. Each promotion is associated with either a Percent Discount, or a Specific Value discount that is then applied the Price of some item listed on the same PDF.  Is this correct?  And you want to know how, using Acrobat JavaScript, to associate the promotion name to the associated discount, and then how to apply that discount to the item price. Is this correct?

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
JR_6739Author
Participating Frequently
November 13, 2021

That is exactly what I am looking to do. 

Thom Parker
Community Expert
Community Expert
November 12, 2021

All is possible, but you need to clearly explain the process. What are all the inputs to the calculation? and how does it procceed for all the different cases?

 

 

 

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often