Skip to main content
JMFreeman
Inspiring
January 13, 2020
Question

pageNum with Continuous Scrolling Enabled

  • January 13, 2020
  • 1 reply
  • 344 views

I have a button positioned near the top of page 2 in a document. I have a text field at the bottom of page 1. I have continuous scrolling enabled. I'm testing what returns with pageNum. I scroll to see most or all of page 1 and the top of page 2, and run the following in console:

getField("test").value = pageNum

This sets the field to "0". Console seems to get whatever the program is displaying at the top as my current page. However the button, running the same script, always gives the page the button is on, even if I scroll to another page before I press it. This can be useful in my project, but I want to confirm my suspicions. Is there a tie to the page a field is on and the value of pageNum, as that field sees it?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
January 13, 2020

How are you running the script attached to the button if you're not viewing it?

What are you trying to achieve, exactly?

JMFreeman
JMFreemanAuthor
Inspiring
January 13, 2020

Imagine having continuous scrolling enabled and viewing all of page 1 and the top inch of page 2.

 

My intent was initially for a button to know to look at other fields on its own page. The button is spawned by a different script, and I want to make sure each button only manipulates the other fields I want it tied to. I noticed the oddity with pageNum and started exploring it. I was more curious about it than anything. Continued research pointed me to regular expressions and the other post you just answered for me. 🙂 Cheers!

 

I am still curious about my question though. To try to ask it more clearly.. Why does pageNum return a different value in console vs. in a script running from a field?

try67
Community Expert
Community Expert
January 13, 2020

You should use the button's page property for that, not pageNum.