10 forms of the same type, each with one submit button (which have distinct
#name attributes), nested within a parent form of a different type. They are nested simply by calling
drupal_get_form() from within another form callback (why am I doing it this way? Well, I have some display suite fields that call
drupal_get_form(), and I am rendering some entities within the parent form, so rendering those entities calls
drupal_get_form() within the parent form function).
All work perfectly, except for the first one of the 10. When its submit button is pressed, the correct
_triggering_element_name is posted, but the
form_build_id posted is the build id of the parent form, not the child form. For all subsequent 9 forms, the correct
form_build_id are posted, and they work perfectly.
The HTML seems to be the same for each of the 10 subforms, i.e. the first one has the hidden
form_build_id input, which has its own distinct value from that of the parent form. This value is just not posted.
Any thoughts? I'm a bit stumped! Even just an idea of where to look to see what's wrong...