Recently, I was building a custom Drupal form that used dependency injection and included an ajax submit handler. While testing the form, on the initial page load, the form submitted just fine using ajax. However, when the user used another ajax handler on the same form, all of the injected services were set to `NULL`.
Recently I needed to modify a Drupal 7 node form to have two drop down select elements populate based upon a third select element's choice. I have altered select elements in the past to have a single dependency, but never have I made one element control the content of two different elements.
To start, I made the first element control the second (the old familiar way):
I need the selection in field_dropdown_1 to dictate what appears in the list for field_dropdown_2 and field_dropdown_3.
Today I needed to create an ajax powered form using Drupal 7, the caveat being that I needed one user action to perform multiple ajax actions to different sections of the form.
To begin, my form element with the ajax looks like this: