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

Custom Calculation for a checkbox

jelrod
Registered: Nov 11 2009
Posts: 2
Answered

I have no java script experience, so I'm completely lost. Here's my problem. I have a check box that needs to perform a custom calculation. When the check box is checked, I need it to add 30 percent to a separate field that is a total of other fields. Ultimately, I have one field that is the total of 4 other fields, and underneath that field is another field for the added 30 percent. When the box is checked, I need it to automatically add 30 percent to the field that is allocated for the 30 percent added to the total. If this makes no sense, please forgive me. Any help would be greatly appreciated.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You don't need a calulation on a check box, you need your existing calculation on a text field to use the checkbox.

I'm assuming that since you are not a programmer that currently your calculation uses the built-in Sum? If you want to use the checkbox then you'll need to use a custom calculation script. There is no way around it.

Read this article:
http://www.acrobatusers.com/tutorials/2006/form_calculations

Then do a search on this forum for "conditional calculation", you'll find lots of thread that address exactly your issue.

You might also want to read this:
http://www.pdfscripting.com/public/department45.cfm

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script