Cannot get AJAX change to work

Created on 30 May 2025, 7 days ago

Problem/Motivation

I'm building a style option that updates as user selects options.

For instance, I have a select that when value 1 is picked, the next form element should be a set of radio buttons. For option 2 then a text area should be shown.

#ajax just has a change event that calls a public function that returns and AJAX response of commands (a single replace command with a css selector).

When I add the #ajax to the select element it triggers, but during the build set, I get an error if I try to get the values from form_state during the build configuration form step.

The subform and parent form must contain the #parents property, which must be an array

I did try to get the complete form state as it was mentioned in another issue reported, but the values don't include anything from the style options.

I would like to avoid manually traversing the posted data, but I'm not sure if I'm missing anything.

Proposed resolution

Have a way to access the posted data as part of the build configuration form step for AJAX requests.

💬 Support request
Status

Active

Version

1.1

Component

Code

Created by

🇨🇷Costa Rica alemadlei

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

Comments & Activities

Production build 0.71.5 2024