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

Show the name of a filed

Participant ,
Nov 01, 2017 Nov 01, 2017

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
469
Translate
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

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

Try:

event.target.name

Translate
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

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.

Translate
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
LATEST

Thank you very much both for your helpfull answers,.

Regards.

Translate
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