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

Basic Math

jbennett
Registered: Aug 14 2007
Posts: 8

I'm working on a form that consists of a series of drop down menus and checkboxes that all have values assigned to them that add up to a "total" field at the end of my document. I'm using the basic math that is offered by the Text field properties, calculate section to say "Value is the Sum of the following fields" for my "total" field.
This works great at first examination, but in using the form, when I select an option from a drop down, then change it, or check, uncheck and then re-check a check box, the total keeps climbing upwards, rather than going up and down based on the value of the item. Put more simply, every time you select one of the items, then change it, the total increases. I need the total to increase and decrease based on what users are selecting. Please help! I appreciate the assistance of the Acrobat community.

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Let's get really basic:

1. What version of Acrobat are you using?
2. Are you using Acrobat or LiveCycle Designer?
3. Under what item are you placing your code?
4. If using the "action of", what fields do you have checked?
Hopefully not the total field.
5. If using the "Simplified Field Name:" can you post the code?
5. Can you post the any FormCalc or JavaScript code used?
6. Have you cleared the total, set it to zero, before adding anything to it?

George Kaiser

jbennett
Registered: Aug 14 2007
Posts: 8
Apologies for lack of data... hope this clarifies:

1. What version of Acrobat are you using?

Acrobat 8.1.0 Professional

2. Are you using Acrobat or LiveCycle Designer?

Acrobat Professional

3. Under what item are you placing your code?

'Code' is applied to the text field designated 'total'. I'm not really using code, since I edited the built in options of the text field as follows: 'calculate' section to say "Value is the Sum of the following fields", and including all of the fields in the form (excluding the 'total' field). No code or action applied to the other fields.

4. If using the "action of", what fields do you have checked?
Hopefully not the total field.

not using 'action of'

5. If using the "Simplified Field Name:" can you post the code?

not using 'simplified field name' that I know of

5. Can you post the any FormCalc or JavaScript code used?

no formcalc of javascript code in play

6. Have you cleared the total, set it to zero, before adding anything to it?

Yep. Default value is set to '0'
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
I have never seen or heard of this. I suppose there could be a naming problem or confusion when using hierarchical field names.

A problem with the "The --- of" is that groups of fields as well as individual fields can be selected. Assume your fields are named "RowTotal.0", "RowTotal.1", and "RowTotal.2". Then you have the choice of summing the individual fields or "RowTotal" but if one selects "RowTotal", "RowTotal.0", "RowTotal.1", and "RowTotal.2", the individual fields and their total will be summed.

I would make a copy of the form and then remove one field and time from the sum list and check the results of the sum until the problem disappears. This should identify the field or fields with the problem.

George Kaiser

jbennett
Registered: Aug 14 2007
Posts: 8
Just to confirm, the basic 'calculate' section that is set with "Value is the Sum of the following fields" should work to do the addition as well as the subtraction that I require? If so that is great. I will get to troubleshooting right away. Thank you for lending structure to my process.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
Sum does only sums and nothing else. It will sum signed numbers correctly so if you have an unsigned number you want to subtract, you have to get that number multiplied by -1 into another field.

George Kaiser

jbennett
Registered: Aug 14 2007
Posts: 8
I am a complete knucklehead. I had flown through the form, entering options like a madperson. When I created my 'total' field, I included it in the fields to calculate to figure the sum. Based on gkaiseril's confirmation of proper function and recommendation that I cross my t's and dot my i's, I doublechecked everything found the error listed above. Thank you again!