Skip to main content
Mae_RVT
Inspiring
November 6, 2019
Answered

go to a field object

  • November 6, 2019
  • 2 replies
  • 589 views

I am wondering if i could get some help in writing a simple script to go to a specific text field. I am working in Acrobat

 

for example when a checkbox is actioned (ticked) to go to a relating field where comments are to be made.

 

I know there is the basic pageNum = 1; etc. coding, but that will only take me to a page, not a specified field.

This topic has been closed for replies.
Correct answer JR Boulay

Place this script as a "mouse up" action in the checkbox:

 

if (event.target.value != "Off") { // if the checkbox is ticked
this.getField("comments").setFocus(); // the target field is activated
}

 

You just have to adjust the target field's name.

2 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
November 6, 2019

Place this script as a "mouse up" action in the checkbox:

 

if (event.target.value != "Off") { // if the checkbox is ticked
this.getField("comments").setFocus(); // the target field is activated
}

 

You just have to adjust the target field's name.

Acrobate du PDF, InDesigner et Photoshopographe
Mae_RVT
Mae_RVTAuthor
Inspiring
November 7, 2019

Perfect! Thank you JR_Boulay

Legend
November 6, 2019

The buzzword here is "focus". The field with focus is, if it is a fill-in form, the one where the cursor appears, and where the user types.