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

Trouble performing a simple addition calculation in LiveCycle Designer

Avatar

Level 2

Hi Everyone, I have browsed the forums and the Internet for a solution to my problem, to no avail. scripts I found in other forums would not work for me. Sorry if I should not be starting a new discussion, but came up short everywhere else. I'm fairly new to JS as well, and brand new to posting a discussion here. Patience is appreciated!

I'm using LiveCycle Designer ES2. I've got a table with a column I would like to add all the cells in the column to a total in the bottom row of the table.

There are 12 cells to add up. The first value of $25 is fixed, and is never to be changed by the user. In binding, I have named the field "Fed1".  I've set it as a Numeric field, type: Read Only, and default to 25.

The rest of the cells will be fillable by users. I have named these cells Fed2, Fed3, Fed4, Fed5, Fed6, Fed7, Fed8, Fed9, Fed10, Fed11, Fed12. These have been set to Numeric Fields and are user-entered - optional.

I want all cells Fed1 through to Fed12 to add up and display the total in the bottom cell, whch I have named "FedTotal".

I have tried FormCalc and variations of Javascript but cannot seem to get any sort of calculation at all.

FormCalc:

I've tried: Sum(Fed1, Fed3, Fed4, Fed5, Fed6, Fed7, Fed8, Fed9, Fed10, Fed11, Fed12)

I've tried: Sum(10527, Fed2, Fed3, Fed4, Fed5, Fed6, Fed7, Fed8, Fed9, Fed10, Fed11, Fed12)  but I receive errors that the cells cannot be determined.

Javascript: I've tried so many scripts, there are too many to list here.

I'm writing the code on the calculate event, written on the Fed13 object.

Please help!

2 Replies

Avatar

Level 2

Hi,

May i ask, how are you accessing the cells in the table?

Thank you

Avatar

Level 2

Thank you for your response - I'm not sure I understand your question,  but hopefully this will help: I created a table, then dragged numeric fields into the cells from the object library. I clicked the numeric fields to name them Fed 1, Fed 2 etc.

Does that help?