I've been lurking and searching on this forum for days and can't seem to make my preferred situation work. I'm new to Acrobat forms, but a professional graphic designer.
I can't seem to make a seemingly simple PDF form function work. It's a calculate tax issue. I'm using Acrobat Pro 8 (on a Mac), and have got several Checkbox export values working correctly. They're exported to a "Package subTotal" field, which adds the checkboxes using the Calculate, Value is sum+ in the Text Field Property dialog box. This function is working as expected, but see below for more details.
I then have a "Tax total" field, which uses the Custom Calculation Script (Java) I found on this forum ...
var f = this.getField("Package subTotal");
event.value = Math.round(f.value * 8.25) / 100;
This is calculating the California Sales Tax rate of 8.25% correctly in my "Tax total" field, which is obviously derived from the "Package subTotal" field.
So here's my problem ... not all people who fill out the form are going to be from CA. I'd like the Sales tax to be applied to the "Package subTotal" field only when/if they click the checkbox titled "Sales tax Box." I've spent 3 days experimenting the Actions tab in the Check Box properties, but to no avail.
_________________________________________
Here's my other dilemma. When a patron uses the form there are 3 major options (checkboxes) available to them. These checkboxes all share the same name, but have different export values, allowing only one to be chosen at a time. If their choice is major option 1, there are 2 other sub-options (checkboxes as well) that I've instructed them to choose. If they choose major option 2 or 3 they won't need the sub-options from 1. How do I get it to function so ... if they click on major options 2 or 3 the sub-options from option 1 are not added to the "Package subTotal" field.
Hope this is clear enough. Any help will be appreciated. Thanks in advance
But, for the tax calc you need to do a conditional calculation based on the "Sales Tax Box".
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