Hi,
Create an array to perform a SUM of the text fields 1 through 14.
There is an example script that shows how to declare a variable in order to array the fields found in the following reference guide: "Developing Acrobat Applications Using JavaScript" https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/AcrobatDC_js_developer_guide.pdf
An example of the custom calculation script is found in pages 84-85 shown below:
var aNumFields = new Array("Text1.0", "Text1.1", "Text1.2","Text1.3",
"Text1.4");
myAverageFunction(aNumFields);
function myAverageFunction(aNumFields)
{
// n = number of fields that have a numerical value
var n=0, sum = 0;
for ( var i=0; i<aNumFields.length; i++) {
var v = this.getField(aNumFields[i]).value;
if ( v != "" ) {
n++;
sum += v;
}
}
if ( n == 0 ) event.value = "";
else event.value = sum/n;
}