Skip to main content
Known Participant
November 14, 2017
Question

event.target.pageNum= help code by detect page

  • November 14, 2017
  • 1 reply
  • 596 views

i have 2 pdf pages Page 1 and Page 2 on adobe DC.

User have option to duplicate Page 2 and create Page 3.

Now i want a code to run only on page 3 when user work on page 3.... i try this :

if (event.target.pageNum=1)

{

this.getField("Text26").value = event.value;

}

if (event.target.pageNum=2)

{

this.getField("Text26_1").value = event.value;

}

but the value takes in Page 1 and Page 2! I want only go to Page 3 if user work in this page........................

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
December 13, 2017

I don't quite understand what you're trying to do, but there are multiple errors in your code.

First of all, the comparison operator in JS is "==", not "=".

Second of all, event.target points to a Field object, which doesn't have a pageNum property, but a page property.

However, if you have multiple instances of the same field then the page property will return an array, not a number, so I'm not sure this is going to help you identify which field was accessed.

Thom Parker
Community Expert
Community Expert
December 14, 2017

Your question is unclear. Where is this code used? which event?  How are you duplicating and creating pages? What is the exact sequence of actions in your process?

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often