Skip to main content
edembers
Participant
April 8, 2018
Answered

Page numbers in form field

  • April 8, 2018
  • 1 reply
  • 2029 views

I want to use the page number in a Javascript formula in a form field, but can‘t get it to work properly. I am using the script:

event.value=pageNum;

but this gives the page number of the last field that was changed! So in a multiple page document with the same script on each page, the result is the same on every page! I need it to always return the page number of the page on which the formula is. How can I do this? Or could I set a hidden footer, and reference it in a script?

This topic has been closed for replies.
Correct answer try67

Each field must have a unique name. Also, change the code to:

event.value=event.target.page;

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 8, 2018

Each field must have a unique name. Also, change the code to:

event.value=event.target.page;

edembers
edembersAuthor
Participant
April 8, 2018

It‘s easy when you know how! Thanks so much, it works perfectly!