Answered
I've been given an Excel form to remake as a PDF. In it are 8 fields that can be used to list job duties (duty1, duty2, etc.). The original form then has a field that counts the number of those duty fields that were actually filled in, using Excel function COUNTA(). Is there a way to duplicate that function in Acrobat?
Donna
// document of folder level function
function CountA() {
/*
Count the non-empty fields, up to 256 fields
Inputs: field names passes as argument to this function
Returns: count of non-empty fields
*/
var nCount = 0; // number non-empty fields
// loop through this functions augment array
for (i = 0; i < arguments.length; i++) {
if (this.getField(arguments[i]).value != '') nCount++; // increment non-empty field
} // end loop
return nCount; // return count
} // end CountA function
// end document or folder level function
// field custom calculation script
event.value = CountA('duty1', 'duty2', 'duty3', 'duty4','duty5');
George Kaiser