ZF-4624: Conditions with Zend_Form
While trying to do some conditions with Zend_Form I figured out that this is actually not possible. The idea was to have two different Subforms. The main form containing only one element, two radio buttons. When the first radio button is selected, only the first Subform should be validated and the second ignored. When the second radio button is selected, it should be just the other way around. The major reason why this was not possible is that you cannot display the radio buttons between Subforms (as they are one element). The only way I see you can achieve this is by doing it hardcoded in a ViewScript but then it cannot be validated.
Radio buttons containing none Subform should also be allowed and it should work with other elements as well, for example a dropdown list. Later on dojo could be used to display only the selected Subform.
Forum thread for this issue: http://nabble.com/-Zend-Form--Conditional-SubForms…