cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic tables: calculation referencing dynamic rows

Former Member
0 Kudos

Hi,

I've created a dynamic table. I'd like to calculate s.th. with dynamically added rows. How can I create a JS calculation referencing dynamic rows? Please find an example below :

working hours

dynamic row

dynamic row

...

sum = sum of dynamic rows

Any help is appreciated,

mading

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I watched the following seminar: https://admin.adobe.acrobat.com/_a200985228/p87746471/ and copied the following lines into my calculate event of a cell called "travelh_sum":

Code:

var flds = this.resolveNodes("$form..Travelinghrs[*].Amount");

var sum = 0;

for (var i=0;i<flds.length;i++)

{

if (isNaN(flds.item(i).rawValue))

sum+=flds.item(i).rawValue;

}

sum;

I got a big table with many columns. What I want to do, is calculate the amount of all travelling hours entered in the dynamically added cells "Travelinghrs". As far as I understand the code, it should work. I changed the cells to "numeric field". When I change to the pdf-preview, there is a "0" in the travelh_sum field but its not calculated. Maybe I can send you my pdf file...I dont want to upload it here for public access..

Thanks a lot

Former Member
0 Kudos

Please. No one there who knows s.th.?

thanks,

Martin