getField returns null in document level javascript
The code shows as below:
app.alert(1);
app.alert(this.getField("IsModified").value);
app.alert(2);
I put the script in document level. When I finish editing the script, it gives me 3 popup as expected.
After I closed the PDF and reopen it, it gives me the first popup ONLY.
I checked the debugger. It gave me the error as below:
TypeError: this.getField(...) is null
3:Document-Level:alertTest
I can tell the problem is on this.getField("IsModified"). But why this happens? And how should I fix it?
