Forum Discussion

Mavis's avatar
Mavis
Ideator I
5 years ago

Is it possible to use the change event trigger of an item to get the name of the field?

hi All,

According to this image,

my method name is " change_field ".

The field names of text boxes framed by dashed lines on the screen are "A", "B", "C", and "D".
The text boxes that are framed with dashed lines have a text box below them that is not framed with dashed lines.
The field names are "A1", "B1", "C1", and "D1" respectively.

I want to get the field name of the current trigger method in the method "change_field", and change the value of other text boxes according to the field name.

Example: The user changes the text box with the field name "A" and triggers the method "change_field".
I need to get the field name of the current text box called "A" in the method "change_field" and read the field name of the current text box called "A" to change the value of the field name of the text box called "A1".

But I don't know how to write the syntax of 「get the field name of the current text box as "A"」

If somebody knows and can help I would really appreciate that.

Thank you.

6 Replies

  • In your method which is attached to onChange event, this.name will give you the name of field which triggered the event.

      • Mavis's avatar
        Mavis
        Ideator I

        hi , silje.dahl

        Are you asking about my solution?

        I use the same on change method for the A, B, C, and D field events
        When the value of field A, B, C, D is changed, go to the field A1, B1, C1, D1
        Because my initial context setting is to backfill the A1 field after the value of A has been changed according to A
        So I use a loop to search for the fields on the screen in the on change event
        I found the A field and determined that it had a value before backfilling it to A1.

        I'm not good at English, so I'm using a translator for the above description.
        If you don't understand what I mean
        The code in the picture below is for your reference