Why am I getting a TypeError?
I have a document level script for updating my page numbers:
function updatePg(){
var f;
for(var p = 0; p < this.numPages; p++){
f = getFieldOn("pgN", p);
f.value = "Page " + (p + 1) + " of ";
this.getField("pgT").value = this.numPages;
}
}I then have it called from a button that spawns pages. It was working, but later without changing that code, I started getting
TypeError: f is undefined
6:Document-Level:updatePg
