How can I loop through specific text fields and not the whole page?
I have a table of text fields separated by two columns, and I need to make sure the number of entries in one column matches a number entered in a text field on a separate page.
So if I say numInColumn1: 4
There needs to be 4 text fields in the first column with something written in them, or else I throw an error. Is this possible? I would need to duplicate this logic for the second column.
I don't have my exact code in front of me, but what I have tried goes like this:
total = 0;
for (i = 1; i < numFields; i++) {
var field = this.getField("Column1Row" + i);
if (/\w/.test(field)) {
total++;
}
}
if (this.getField("numInColumn1") != total) {
app.alert("value does not match the total of " + total);
event.rc = false;
All of the errors I have gotten when tweaking this in different ways is the program either counting all of the fields in the pdf file or not getting an error message at all. Any help is appreciated.
