• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

go to a field object

Explorer ,
Nov 06, 2019 Nov 06, 2019

Copy link to clipboard

Copied

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.

TOPICS
Acrobat SDK and JavaScript

Views

296

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 06, 2019 Nov 06, 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.

Votes

Translate

Translate
LEGEND ,
Nov 06, 2019 Nov 06, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2019 Nov 06, 2019

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 06, 2019 Nov 06, 2019

Copy link to clipboard

Copied

LATEST

Perfect! Thank you JR_Boulay

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines