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

Show the name of a filed

Participant ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

Hello.

Is there a way (javascript) to get the name of a field or a button when you click on it and display it with app.alert?

Thanks in advance for your advice.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

323

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 01, 2017 Nov 01, 2017

Try:

event.target.name

Votes

Translate

Translate
Community Expert ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

Try:

event.target.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
LEGEND ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

There is a "name" property for a field object.

One can use a script like:

"app.alert("Field name: " + event.target.name, 3, 0);

In the one of the action options for the field in the "Create form" tool, but then you would see name on the "General Tab".

You can use the "getNthFieldName" method to list all the names on the form in the JavaScript Console.

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
Participant ,
Nov 01, 2017 Nov 01, 2017

Copy link to clipboard

Copied

LATEST

Thank you very much both for your helpfull answers,.

Regards.

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