Subforms don't execute automatically when they don't have buttons. This is normal behavior because it doesn't set a triggering element. But it would be nice if they did (without the need of extra code).
Subforms don't execute automatically when they don't have buttons. This is normal behavior because it doesn't set a triggering element. But it would be nice if they did (without the need of extra code).
Comments
Comment #1
emilymoi commentedHi casey,
This is a great module. I am trying to do what you are describing here--embedding a subform that does not have buttons. If I remove the actions from the subform, the #submit handlers are never called.
Is there a workaround that would make this work (besides hiding the button with css)?
Comment #2
emilymoi commentedPlayed around a bit.
Setting $form_state['submitted'] = true on the subform's form_state seems to work well.
Comment #3
jbeuckm commentedWhere do you do set $form_state['submitted'] = true? I'm trying to make my wrapper form submit its subforms without having actions or buttons on the subforms.
Comment #4
Donatoo commented+1
Comment #5
casey commentedProblem is that forms might need an actual triggering element (like when containing file elements). And there is no good way of detecting if that is the case. So a generic solution is tricky.
If you are however sure your subform doesn't, you can do something like: