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

Calcualting Totals on a from using Check Boxes

ncassella
Registered: Feb 21 2011
Posts: 3
Answered

Hello All,
 
I'm new to form creation. Using Acrobat X I have created a form that contains the following information in a similar layout.
|No Header|__ Plan Name__|__Monthly Cost___| Annual Cost___|
|Check Box | Domestic Plan_|______10_______|_____120_____|
|Check Box | Internal Plan___|______20_______|_____240_____|
|Check Box | Message Plan1 |_______5_______|______60_____|
|Check Box | Message Plan2 |______10_______|_____120_____|
|_________|_____________|_____Total______|____Total_____|
 
On this particular form the totals need to be calculated using the check box that corresponds to that row. For Example, if a user checks Domestic Plan & Messaging Plan1 I want the totals to read 15 and 180 respectively.
 
I want to make sure all the values appear so the end user knows the cost of what they are selecting prior to doing it.
 
I assume this is a java script that I would have to write to preform this correctly, however I am far from a programmer so wouldn't know how to create the code correctly.
 
So I have two questions:
First, I'd like to know if the only way to solve this issue is to write a script, and if so can someone please either provide me with the skeleton of one or point me to a site where I can quickly learn how to put a basic one together.
 
Second, If there's another way to do what I'm trying to accomplish can some please enlighten me.
 
Thanks and sorry for the newbi question and the ugly formatting,
Nate

My Product Information:
Acrobat Standard 10.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Accepted Answer
No, you don't need to use a script. Acrobat does, but you don't.

If you set the export value of each check box to the corresponding cost, you can set up the monthly total field so that it sums all of the check box fields. On the Calculate tab of the text field, select "Value is the sum (+) of the following fields" and add the check boxes to the list. Acrobat will use JavaScript behind the scene to perform the calculation.

The Annual Cost field can be calculated based on the Monthly Cost field using the simplified field notation option. Just enter: MonthlyTotal * 12

where "MonthlyTotal" is the name of the field. Don't use spaces in this field name
ncassella
Registered: Feb 21 2011
Posts: 3
Thank you for the response George, I was wondering what the "Export Value" field meant. This solved the problem easily. Just one more question, I see you said not to use spaces in the MonthlyTotal field name, is there a reason for this?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
When you use the simplified field notation option for the calculated field, it won't work when specifying field names with spaces. There is a workaround, but it's best not to use fields with spaces in the first place.
ncassella
Registered: Feb 21 2011
Posts: 3
OK I understand now. Thank you very much for all the help, I just completed the form.