Skip to main content
PasGlop
Inspiring
November 1, 2017
Answered

Show the name of a filed

  • November 1, 2017
  • 2 replies
  • 522 views

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.

This topic has been closed for replies.
Correct answer Bernd Alheit

Try:

event.target.name

2 replies

Inspiring
November 1, 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.

PasGlop
PasGlopAuthor
Inspiring
November 1, 2017

Thank you very much both for your helpfull answers,.

Regards.

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
November 1, 2017

Try:

event.target.name