Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to do math in forms in Designer

Not applicable
using Acrobat Pro 8.1.2



I'm trying to turn a paper form (already in PDF format) into a fill-out-able form with fields, some text, some numerical, some containing very simple formulae.



I've tried to create it in Designer and ended up hopelessly lost when trying to figure out *how* to put the formulae in the appropriate form fields.



Here's an example of what I need to do:



Total = field1 + field2 + field3



...and so on, max fields being added is 7 or 8.



Nothing fancy, nothing complicated, the fields are 1 or 2 digit values, and it needs to update the total if any of the variable fields' values changes.



I've tried following through the rather arcane help file, and only ended up confused and irritated.



Help????
7 Replies
kimbradford
Level 2
Level 2
You would type in the script field:



sum(field1)+(field2)+(field3)



Make sure that you are using the script in FormCalc and that the calculate button is shown on the field to your left of the script field.
gkaiseril
Level 7
Level 7
In LiveCycle Designer's menu bar look under the "Help" option there should be a "Scripting Reference" that includes information about entering scripts. Also there are many predesigned templates that have examples of calculation scripts. There are also on demand eSeminar videos on the Acrobat Users Community site, http://www.acrobatusers.com/ .



You can also use the "Sum()" function to add a series of fields:



Sum(field1, field2, field3)
Not applicable
Kim said:

>You would type in the script field:



>sum(field1)+(field2)+(field3)



What I've actually got is:

field1 field2 field3 field4



fields 1, 2 and 4 get user-entered values, field3 is the sum of them.



>Make sure that you are using the script in FormCalc and that the >calculate button is shown on the field to your left of the script >field.



I've got it set for FormCalc, but I have no idea what you're talking about with the calculate button???
gkaiseril
Level 7
Level 7
The function name is "Sum()", all function names, methods, field names, etc are case sensative.



Try the following in the "Calculation" script section of field3:



Sum(field1, field2, field4)



You want all the field names within the parameter list for the Sum function so empty or non-numeric fields are treated as being zero and not undefined or anything else.
Not applicable
Sorry to seem(?) overly dense, but just exactly *how* do I enter this:



>Try the following in the "Calculation" script section of field3:



>Sum(field1, field2, field4)



I have NO idea where I'm supposed to put this. Does it somehow go in the Palette, or what???



What if I were to re-create this document in Excel (with which I'm a LOT more familiar), complete with all the formulae I require - is there a way to import it "lock, stock, and barrel" into Acrobat and thusly kick out a properly-working document???



I'm really stumped!
gkaiseril
Level 7
Level 7
Have you looked at the eSeminars on demand I have linked to or the "Scripting Reference" under LiveCycle Designers help?



You have to have the "Script Editor" open in LiveCycle Designer, and select the "text3" field, set the binding for this field as "read only, calculated", and cut and paste the script into the "Calculation" event for the "text3" field.
Not applicable
Brian, send me an email and I'll be happy to help: gretchen.payne@wch-rcc.com