Dynamic Page Number - Calcuation
I have been trying to set up dynamic page numbering for a fillable form I have created. There are several fields on the form that cause pages to either spawn or delete, so I am wanting the script to auto update the page numbers and the total number of pages. I have been researching this for several days online and have found several different scripts and none of them seem to work properly. This is the one that has made the most headway.
event.value = "Page " + (event.target.page + 1) + " of " + (this.numPages);
The problem I am running into is that when I use the event.target.page I get weird answers like "-1,21 of 4" then "-1,31 of 4" on the next page, etc. Does anyone know why the form is calculating this way? The number is increasing, I guess, on each page and the total number of pages is correct, but that number formatting is wrong.
I have also tried this variation:
event.value = "Page " + (this.pageNum +1) + " of " + (this.numPages);
That script just gives me "Page 1 of 4" on every page. The total number of pages is correct, but obviously the current page number is not.
Thoughts?
