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, PDF forms

Views

65

Likes

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

Adobe Community Professional , 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.

Likes

Translate

Translate
Most Valuable Participant ,
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.

Likes

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
Adobe Community Professional ,
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.

Likes

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

Likes

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