I have a form with a subform, and the setElementsBelongTo is *not* equal to
the name of the subform. Something like this:

$form = new Zend_Form();

$form->addElement('text', 'textfield', array('required' => true, 'label' =>
'Field from form'));

$sf = new Zend_Form_SubForm();
$sf->addElement('text', 'textfield', array('required' => true, 'label' =>
'Field from subform'));
$sf->setElementsBelongTo('subform');
$form->addSubForm($sf, 'subform1');

$form->addElement('submit', 'Submit');

When I try to display this form, the "FormErrors" decorator only displays
the error from the parent form:

<li><b>Field from form</b><ul class="errors"><li>Value is required and can't
be empty</li></ul></li>

If the two are equal, it renders correctly:

<ul class="form-errors"><li><b>Field from form</b><ul
class="errors"><li>Value is required and can't be empty</li></ul></li><ul
class="form-errors"><li><b>Field from subform</b><ul
class="errors"><li>Value is required and can't be
empty</li></ul></li></ul></ul>

Has anybody experienced this before?

Reply via email to