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

totaling two fields in a third

WayneH
Registered: Sep 3 2009
Posts: 19
Answered

I have read all the posts about formcalc, etc and have no clue what is going on. All I need to do is have Livecycle automatically sum the total of two simple number fields into a third. Number of students and number of adults for into a total field. I am not a code writer, and am really new this. Thanks for your help in advance.

My Product Information:
LiveCycle Designer, Windows
Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

Suppose you have three numeric fields with name NumericField1, NumericField2 and NumericField3.

If you need to simply want to set answer of NumericField1 + NumericField2 into NumericField3, then;
1. Click to select NumericField3
2. Menubar Window -> Script Editor
3. Change "Show" menu in script editor to "calculate"
4. Confirm "Language" menu in script editor is "FormCalc"
5. Input script like below

$.rawValue = NumericField1.rawValue + NumericField2.rawValue
WayneH
Registered: Sep 3 2009
Posts: 19
I'm sorry, where do I insert the text? Rather, I see this, where do I put the text you gave me?

----- form1.#subform[0].TextField34::calculate: - (FormCalc, client) -------------------------------
Bamboolian
Registered: Jul 27 2010
Posts: 48
Is the TextField34 where your sum goes to?

then place the text after like

form1.#subform[0].TextField34::calculate: - (FormCalc, client)$.rawValue = NumericField1.rawValue + NumericField2.rawValue

Make sure you change "NumericField1" and "NumericField2" to field name that you created for Number of students and number of adults.
WayneH
Registered: Sep 3 2009
Posts: 19
Thank you! This worked, finally!