Answered
Can anyone help me calculate a total in Acrobat 8 Professional:
Annual Enrollment Fee = $865.00
Number of Staff [ ] x $12 = [ ]
Grand Total = [ ]
I know this seems SO simple, but nothing I'm doing is working. Do I need to set up invisible fields or can the 865 and 12 be in a calculation script? Is there a validation I need to set up? What happens if the user changes the staff #, will it automatically recalculate the total?
You don't have to set up hidden fields, but you can if you want to use one of the built-in calculation methods (e.g., value is the sum..., simplified field notation). If you want to use JavaScript, you would simply use the constants 865 and 12 in your script. But it's not clear to me what formula your script should use. If you describe in words what the grand total should be, someone could suggest specific code. Is it?: Grand Total = $865 + Number of Staff x $12
If so, the custom calculation script for the grand total field could be:
You would replace "Number of Staff" in the code above with the actual name of your field. You might want to add code to prevent the display of a result if the number of staff is blank (or zero):
And yes, the calculation script will automatically recalculate the grand total whenever any field value changes.
Regarding validations, you may want to set up a validation to prevent the user from entering an invalid number (e.g., number of staff = -1, 1,000,000, or 2.7).
George