I'm having trouble iterating over all of the fields in my document to remove the tooltip. Here's my code:
var index=0;
while(index<this.numFields)
{
var nom=this.getNthFieldName(index);
var fieldName=this.getField(nom);
fieldName.userName = "";
index=index+1;
}
I'm getting an error saying fieldName is null
and my script won't run. I've seen this answer already:
Iterating over all fields in a PDF form with JavaScript
I get the same error with that code too. If I manually assign a field name to fieldName
using var fieldName=this.getField("field1");
, it works fine.
Does anyone have any idea why this would error on me?
Edit:
I can iterate over the list and output nom
to the console so I know it's grabbing the names of the fields properly. It seems to have trouble dropping that name into the this.getField(nom)
statement. No idea why...