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

Added instance will not calculate

wdoughertyiii
Registered: Jul 27 2009
Posts: 5
Answered

Greetings:

I have created a form which has several fields to sum. One of the fields has the ability to have multiple instances. I have problems with the Total field's calculation being incorrect.

Situation: I fill the amount field on the first instance. It sums correctly. When I click the button to add another instance of the field the Total field goes blank and any amounts I type in any instance do not add. The field just stays blank.

Total field script:
Row1[0].Transportation+xfa.resolveNode("Misc.Misc\..Billing")+Row2[4].Lodging+Row2[8].PerDiem

Add instance button script:
TravelRequest.#subform[0].EstimateofExpenses.Table2.Row2[2].#field[0]::click - (JavaScript, client)
// Invoke the Instance Manager to add one instance of the Misc subform.

_Misc.addInstance(true); // Short form of the instance manager syntaxxfa.form.recalculate(true) // Invoke the recalculate method to include the field values from Table2._­Misc.addInstance(1);

xfa.form.recalculate(true) // Invoke the recalculate method to include the field values from the added subform in the form calculations.

Can you help me? Thank you!

Will Dougherty III
Three Rivers Community College

Will Dougherty III

wdoughertyiii
Registered: Jul 27 2009
Posts: 5
I appreciate your reads. If anyone can comment, I really would appreciate it, as the college administration is wanting to start using this form immediately. Thanks once again. -Will

Will Dougherty III

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Have you looked at the sample forms provided with LiveCycle Designer?

At least one is a dynamic form with a calculation script.

George Kaiser

wdoughertyiii
Registered: Jul 27 2009
Posts: 5
Thanks a million, gkaiseril, it worked. I used the following script within another addition formula:
Sum(M[*].Billing)
or
Sum(nameofbodyrowinsubforminstance[*].nameoffieldtobecacluated)

Will Dougherty III