I have a long list of numbers that users will input (78 numeric fields). They do not all fit onto one page, so I have them split. 26 of them are one page one, and 27-78 are on page two. I want the sum of these fields to show at the bottom of page 2. I have tried two different scripts, but cannot get the sum of the fields from both pages.
Script 1:
Under calculate, I placed the script:
var fields = xfa.resolveNodes("PARIS[*]");
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
total = total + fields.item(i).rawValue;
}
this.rawValue = total;
This only adds the sum of the fields on the page that it appears on (page 2).
Script 2:
Under layout:ready, I placed the script:
var fields = xfa.layout.pageContent(0 , "field", 0);
var total = 0;
for (var i=0; i <= fields.length-1; i++) {
if (fields.item(i).name == "PARIS[*]") {
total = total + fields.item(i).rawValue;
}
}
this.rawValue = total;
This script is currently not working, but earlier it was only showing the total of the fields from the first page.
Does anyone have any suggestions or solutions?
Thanks in advance.