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

Trying to add additional sheets to a form and calculation issue [Form]

Tech264
Registered: Apr 4 2008
Posts: 111
Answered

Good day!

Attached is a form I've designed in LCDS 8.2. What I'm trying to accomplish is adding additional sheets of the same page. I've seen examples on the forum and looking at the Javascript Basics guide of adding additional instances of rows in a table or subform. However, I didn't see any information of adding instances of the entire page. In the past I've done things like this using checkboxes and hiding pages but I just want to add additional ones or remove extras that I don't need for our patients when they sign-in.

Secondly, on the same form I have a total calculation using formcalc and even though it works I'm wondering if coding could be a lot more simpler or this is how it's done.

form1.Page1.Table1.Row11.Amount::calculate - (FormCalc, client)

(Page1.Table1.Row3.Amount+Table1.Row4.Amount+
Table1.Row5.Amount+Table1.Row6.Amount+Table1.Row7.Amount+
Table1.Row8.Amount+Table1.Row9.Amount+Table1.Row10.Amount)

http://www.narcofreedom.com/Forms/token%20form.pdf

My Product Information:
LiveCycle Designer, Windows
hcorbin
Registered: Aug 11 2009
Posts: 57
Hi,

Pages are subforms therefore you can use the same mechanism to add/remove instances of a page i.e. use the instance manager. For example:

// Add a page - this script lives in the add button_Page1.addInstance(1); // Remove this page - this script lives in the remove buttonthis.parent.instanceManager.removeInstance(this.parent.index);

Be sure to allow Page1 to repeat in the object palette | Binding tab.

As for the script, from what I see, row3 to row10 are identical. You could delete row4 to row10. Rename row3 to row, allow it to repeat a minimum of 8 times. With this structure, you can use the following script:

Sum(Table1.Row[*].Amount)
Does this make sense?

Hélène
Tech264
Registered: Apr 4 2008
Posts: 111
Thank you for both answers they worked perfectly.