Show the name of a filed

Participant ,
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.

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Try:

event.target.name

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

100

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

Show the name of a filed

Participant ,
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.

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Try:

event.target.name

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

101

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
Nov 01, 2017 0
Adobe Community Professional ,
Nov 01, 2017

Copy link to clipboard

Copied

Try:

event.target.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
Reply
Loading...
Nov 01, 2017 0
Adobe Community Professional ,
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.

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

Copy link to clipboard

Copied

Thank you very much both for your helpfull answers,.

Regards.

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