Get submitted value from more than one form element

Created on 17 July 2025, 16 days ago

Hi Jürgen and team

I have a form with two or more (select) fields whose values need to be determined. All of these fields have an Ajax handler.

With each entry in one of these fields, a value in another form-field should change (in my case, it's a "Unit Price").

I tried using "Form field: get submitted value."

The problem is that a different output is generated depending on whether a field was last actively changed or previously.

In my case, I have a "pontic" field and an "implant" field, both of which are select fields with values from 1 to 10.

For example, as soon as the user switches the "implant" field (to "2"), I see in the debug:
- field_pontic (DTO)
  - 0 (DTO)
    - value (string "2")

In contrast, the "implant" field, which the user had just previously set to "2" (coincidentally same value...) , shows in debug:
- field_implant (string "2")

If the user now selects another value in "implant", the output is reversed:

- field_pontic (string "2")

- field_implant (DTO)
  - 0 (DTO)
    - value (string "3")

In the lower case, I can output the value using
- field_pontic[0][value]

in the upper case, using
- field_implant

to obtain a value for each token.

But this way the tokens remain inconsistent – they are either correct or "NULL", as long as I only use one of the two token methods.

Maybe I'm just missing the forest for the trees.
What can I do?

Thanks a lot for any hints!

💬 Support request
Status

Active

Version

2.1

Component

Miscellaneous

Created by

🇩🇪Germany 4kant

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @4kant
  • 🇩🇪Germany jurgenhaas Gottmadingen

    That given information is impossible to debug. It's unclear what the context is, i.e. data structure, field types, data entered, etc. Also, no idea about the event or what not. Things like this either need to be debugged locally by the user themselves, or a clear instruction on how to reproduce the issue. The latter would require a model including all the config entities for entity type, their fields, their form configuration, and then an ECA model that shows the issue. That combined with detailed steps on how to reproduce.

    Such support request need to provide information about the used versions of Drupal core, ECA, etc. and the sample model needs to show the problem on a vanilla Drupal site without any other modules, unless others are required to reproduce the issue.

  • 🇩🇪Germany 4kant

    Thank you for your reply, Jürgen.
    Please excuse the lack of all this information.
    I was worried that I didn't fully understand the problem. This was reflected in the way I presented it ;-)
    I'll try to be more detailed or get back to you with the solution.

    Thanks again and have a nice weekend.
    Wiegand

Production build 0.71.5 2024