Copy link to clipboard
Copied
I need a field (lines verified), to show if there is data in a group of other fields. i.e 5 fields, only three have data. I need the lines verified field to show 3.
Hope I explained somewhat
Yes, I am new to scripting
TIA
You can use this code as the custom calculation script of the "lines verified" field to do it (just adjust the field names in the first line):
var fields = ["Text1", "Text2", "Text3"];
var totalFilled = 0;
for (var i in fields) {
if (this.getField(fields[i]).valueAsString!="") totalFilled++;
}
event.value = totalFilled;
Copy link to clipboard
Copied
Hi Alan
Hope you are doing well and thanks for reaching out.
The workflow you are trying to achieve is possible using JavaScript. For more information please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html
Hope it will help
Regards
Amal
Copy link to clipboard
Copied
You need to be specific about what exactly do you mean by verified.
Are you trying to perform anarithmetic calculation that shows the total in another field ? (for example)
If yes, you can use the built-in calculating features or employ a JavaScript script.
Otherwise, please describe in more detail what type of values are contained in those text fields (i.e. names, numbers, fractions, decimals)
Copy link to clipboard
Copied
Hello and thanks.
This document is like an invoice; a list of 10 items each with a field for quantities. On the invoice there is a field that needs to verify if there is a quntity in any or all of the quantity fields, not a sum only if there is an entry.
Copy link to clipboard
Copied
You can use this code as the custom calculation script of the "lines verified" field to do it (just adjust the field names in the first line):
var fields = ["Text1", "Text2", "Text3"];
var totalFilled = 0;
for (var i in fields) {
if (this.getField(fields[i]).valueAsString!="") totalFilled++;
}
event.value = totalFilled;
Copy link to clipboard
Copied
Hi ,
Thanks for the sript.
I really need to learn this.
Thanks again I appreciate this.