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

dynamics tables: calculation

mading
Registered: Jun 12 2008
Posts: 20

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

My Product Information:
LiveCycle Designer, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi mading,

There is an e-seminar recording here at AUC that should help you out with how to do this in your form ( Extending LCD Forms with JavaScript and FormCalc).

https://admin.adobe.acrobat.com/_a200985228/p87746471/

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
mading
Registered: Jun 12 2008
Posts: 20
Hi Dimitri,

thanks for the very helpful answer! I watched the seminar and copied the following lines into my calculate event of a cell called "travelh_sum":

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

mading
mading
Registered: Jun 12 2008
Posts: 20
pleaaaaseeee. anyone there who knows s.th.?

thanks!