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

How to find a field variable for Java-Script?

Explorer ,
Dec 07, 2018 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!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

126

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

Community Expert , Dec 07, 2018 Dec 07, 2018

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
Community Expert ,
Dec 07, 2018 Dec 07, 2018

Copy link to clipboard

Copied

LATEST

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

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

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