Copy link to clipboard
Copied
This is my first foray into using page templates in Acrobat. I have a form that has one nonrepeating page (first page) and one repeating page (hidden page template). The first page has a 'Total of all values' field that needs to calculate the sum of all 'Subtotal' fields contained on all pages, including the first page and all spawned pages. Please see the attached sample form (simplified version).
Just an FYI, my javascript skills are limited.
Any help in this matter is greatly appreciated.
This script makes the total of all text fields containing the word "Value" in their name:
var count = 0;
for (var i = 0; i < this.numFields; i++) {
var oFld = this.getField(this.getNthFieldName(i));
if (/Value/.test(oFld.name) && oFld.type == "text") {
count = count + Number(oFld.value);
}
}
event.value = count;
It is in the red field, as a calculation script, on page 4: https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:233eb4ee-04f4-404a-bd3a-6889c6ffb3f5
Copy link to clipboard
Copied
This script makes the total of all text fields containing the word "Value" in their name:
var count = 0;
for (var i = 0; i < this.numFields; i++) {
var oFld = this.getField(this.getNthFieldName(i));
if (/Value/.test(oFld.name) && oFld.type == "text") {
count = count + Number(oFld.value);
}
}
event.value = count;
It is in the red field, as a calculation script, on page 4: https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:233eb4ee-04f4-404a-bd3a-6889c6ffb3f5
Copy link to clipboard
Copied
Thank you JR Boulay for your quick response.