Expand my Community achievements bar.

SOLVED

Calculations on a Form

Avatar

Level 2

Working in LiveCycle Designer.

Created an 8-page form.  Each page with the exception of the last page has a number in a text field that I want to reference on the last page:

Page 1 - Advisory Committee (5 Points)                                         __________     (I want the number from Page 1 referenced here)                 

Page 2 - Project Abstract/Goals & Objectives (10 Points)               __________  (I want the number from page 2 referenced here)

Page 3 - Description of Needs & Baseline Data (10 Points)            __________  (I want the number from page 3 referenced here)

Page 4 - Activities (10 Points x 2)                                                   __________ (I want the number from Page 4 referenced here)

and so on.

Total Score (Maximum of 100 Points)                                                __________ (I want all the numbers from all the pages added up and autofilled here)

Each text field is named TextField1, TextField2, and so on.

Your assistance is greatly appreciated!

S.

1 Accepted Solution

Avatar

Correct answer by
Level 7

If all you're doing is summing the fields and you don't need to differentiate the pages/subforms/fields, you can cut your script to:

Sum(form1.page[*].subform[*].field[*])

In this example, you simply name your pages, subforms and fields the same.

View solution in original post

7 Replies

Avatar

Level 1

Try using FormCalc to calculate the sum of your fields across numerous pages.  For example, the calculation

F.P8.Textfield8=sum(F.P1.Textfield1+F.P2.Textfield2+... +F.P7.Textfield7)

would take each Textfield from each page and sum it together on page 8.  Check out page 2 of 2 (Total Expense row) of the attached file to see how I added across two pages.  (The two pages in the attached file are the third and fourth pages from another file; hence, the use of "P3" and "P4" in the calculations.)

Avatar

Correct answer by
Level 7

If all you're doing is summing the fields and you don't need to differentiate the pages/subforms/fields, you can cut your script to:

Sum(form1.page[*].subform[*].field[*])

In this example, you simply name your pages, subforms and fields the same.

Avatar

Level 2

So would it be listed as this:

Sum(form1.page[1].subform[1].numericfield[1])(form2.page[2].subform[2].numericfield[2])(form3.page[3].subform[3].numericfield[3])+(form4.page[4].subform[4].field[4])

Ms. Shayne R. Ortmeier

Professional Assistant

Curriculum, Instruction & Innovation Team

Department of Education

301 Centennial Mall South, 6th Floor

Lincoln, NE 68509

Direct Line: 402.471.0511

Fax: 402.471.0117

Signature Strengths

  • Restorative * Significance * Context * Responsibility * Focus *

Avatar

Level 2

I tried this and I'm getting an error stating that I'm using FormCal as opposed to Java... Can I use both or am I locked down to one? I've been using Java scripting.

Ms. Shayne R. Ortmeier

Professional Assistant

Curriculum, Instruction & Innovation Team

Department of Education

301 Centennial Mall South, 6th Floor

Lincoln, NE 68509

Direct Line: 402.471.0511

Fax: 402.471.0117

Signature Strengths

  • Restorative * Significance * Context * Responsibility * Focus *

Avatar

Level 7

You just need to select FormCalc as the language in the drop down box

Avatar

Level 2

Great! Thanks so much!!!

Ms. Shayne R. Ortmeier

Professional Assistant

Curriculum, Instruction & Innovation Team

Department of Education

301 Centennial Mall South, 6th Floor

Lincoln, NE 68509

Direct Line: 402.471.0511

Fax: 402.471.0117

Signature Strengths

  • Restorative * Significance * Context * Responsibility * Focus *