About function in document-level JavaScript.
There is a data list of 20 columns in the form. Initially I was writing the following code in all 20 fields. This was working as planned.
var x = event.target.name;
var i = x.slice(4);
var CheckA = this.getField("CheckA"+i);
if(CheckA.isBoxChecked(0)){event.value=1;}
else{event.value=0;};
I created the following simple function in document-level JavaScript.
function CalA() {
var x = event.target.name;
var i = x.slice(4);
var CheckA = this.getField("CheckA"+i);
if(CheckA.isBoxChecked(0)){event.value=1;}
else{event.value=0;};
}
And I tried to change the following code into 20 fields.
CalA();
There was no problem in the first field I changed. However, when I change the second field, debugging will start and the following display will appear.
TypeError: CalA is not a function
1:AcroForm:CalA1:Calculate
TypeError: CalA is not a function
1:AcroForm:CalA2:Calculate
What is happening and how can I resolve it?
