How to find a field variable for Java-Script?

Explorer ,
Dec 07, 2018

Copy link to clipboard

Copied

Good evening, we are trying to find the specific name of a form field so that we can make changes to them.

We have tried using the traditional, "Text field name" but that doesn't seem to work much.  This is the code that we have so far

if (field.variable == "TX"){

    console.log("help!")

}

All of our code is right, except for for the form field name.

Any help would be appreciated!

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

First, I would suggest watching the videos here:

Free Video Content & Full Listing of Available Videos

They'll explain that while core JavaScript is the same everywhere, each program it is integrated into is has a different Document Object Model. The Acrobat DOM is significantly different from the Browser (i.e. web page) DOM. 

The code you've listed above is for a Web Browser and will not work in a PDF Form. 

Please refer to the Acrobat JavaScript Reference for details.

Acrobat DC SDK Documentation

TOPICS
Acrobat SDK and JavaScript, Windows

Views

96

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

How to find a field variable for Java-Script?

Explorer ,
Dec 07, 2018

Copy link to clipboard

Copied

Good evening, we are trying to find the specific name of a form field so that we can make changes to them.

We have tried using the traditional, "Text field name" but that doesn't seem to work much.  This is the code that we have so far

if (field.variable == "TX"){

    console.log("help!")

}

All of our code is right, except for for the form field name.

Any help would be appreciated!

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

First, I would suggest watching the videos here:

Free Video Content & Full Listing of Available Videos

They'll explain that while core JavaScript is the same everywhere, each program it is integrated into is has a different Document Object Model. The Acrobat DOM is significantly different from the Browser (i.e. web page) DOM. 

The code you've listed above is for a Web Browser and will not work in a PDF Form. 

Please refer to the Acrobat JavaScript Reference for details.

Acrobat DC SDK Documentation

TOPICS
Acrobat SDK and JavaScript, Windows

Views

97

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
Dec 07, 2018 0
Adobe Community Professional ,
Dec 07, 2018

Copy link to clipboard

Copied

First, I would suggest watching the videos here:

Free Video Content & Full Listing of Available Videos

They'll explain that while core JavaScript is the same everywhere, each program it is integrated into is has a different Document Object Model. The Acrobat DOM is significantly different from the Browser (i.e. web page) DOM. 

The code you've listed above is for a Web Browser and will not work in a PDF Form. 

Please refer to the Acrobat JavaScript Reference for details.

Acrobat DC SDK Documentation

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
Reply
Loading...
Dec 07, 2018 0