These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Custom calculation script question

chansen
Registered: Jan 9 2008
Posts: 2

Need help scripting in Acrobat 8P.
 
I have a list price field, discount field (end user will enter the percentage of discout (20, 25, 30, etc.)), and discounted price field.
 
What would be the best way to script it to calculate the discounted price (list - discout)?

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Macintosh
tedpadova
ExpertTeam
Registered: Dec 31 2005
Posts: 848
Try this:

// user entry field is: discount

var f =this.getField("discount");
var g =this.getField("amount");
event.value = g.value - (f.value * g.value);

ted

The author of numerous books on Acrobat, Photoshop, Illustrator and the Adobe Creative Suite, and an international speaker on Adobe Acrobat, Ted Padova is a well-known PDF guru.