After submit there is no value reported for the second select 'color' added by the ajax callback.

Suggestion: Move the form element 'color' to buildForm(). Similar to the D7 version where the second dropdown is also in form build and the ajax callback is empty.

CommentFileSizeAuthor
#2 2774601-2.patch6.05 KBpfrenssen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

k4 created an issue. See original summary.

pfrenssen’s picture

Status: Active » Needs review
FileSize
6.05 KB

This example is indeed broken. I lost some time today because it wasn't immediately clear that my form wasn't working through a mistake of my own but because the example isn't working.

I have fixed the example and have also updated it so it follows correct coding standards and Drupal best practices.

  • Mile23 committed 21259c2 on 8.x-1.x authored by pfrenssen
    Issue #2774601 by pfrenssen: Ajax Form Example does not submit the value...
Mile23’s picture

Component: AJAX Example » FAPI Example
Status: Needs review » Fixed
Related issues: +#2889497: Add a functional test of form_api_example ajax color temperature form.

This really needs a functional javascript test, but let's make that a follow-up since this is a bug.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.