I am new to creating calculations using Acrobat. I have a form where a user can enter up to 4 pay check amounts. I can get Acrobat to calculate the sum of those 4 fields. Here is where I am lost. I would also like to calculate the average of the sum based on the number of pay checks entered. From that, I would like to calculate an average pay amount based on whether the employee is paid weekly (x 4.333), bi-weekly (x 2.167), or semi-monthly (x 2). Any help will be greatly appreciated. Thanks…Mike.
[link=mailto:Michael [dot] Torrick [at] dfa [dot] state [dot] ny [dot] us]Michael [dot] Torrick [at] dfa [dot] state [dot] ny [dot] us[/link]
[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/form_calculations/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/form_calculations/[/url]
And this on on dates calculations:
[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/[/url]
To calculate your average you'll need to detect empty fields. Empty Fields typically have a null value, but this is not always true. It might just be an empty string or even white space. You can use this line of code to do empty field detection. The field is named "input1".
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script