nolner schrieb:
> (I also seemed to me that I should be able to pass concrete elements into
> addDisplayGroup - simply for consistency with addElements - as used in the
> tutorials I've seen)
>
> But, my question is related: I'm simply trying to create a radio group in a
> fieldset (displayGrouup) - but having no joy. In fact I can't seem to add
> anything to a displayGroup - getting: No valid elements specified for
> display group - even for text fields (using 1.6rc2)
>
> Heres the code from my form constructor:
> $rad = new Zend_Form_Element_Radio('foo', array(
> 'multiOptions' => array(
> 'foo' => 'Foo Option',
> 'bar' => 'Bar Option')
> ));
> $this->addDisplayGroup(array('foo'), 'failure',array ( 'legend' =>
> 'Contact Form '));
>
> Anything obviously wrong?
You have to add the form element to the form before you can add it to a
display group.
$rad = new Zend_Form_Element_Radio('foo', array(
'multiOptions' => array(
'foo' => 'Foo Option',
'bar' => 'Bar Option')
));
$this->addElement($rad);
$form->addDisplayGroup($rad, 'failure',array(
'legend' => 'Contact Form '
));
Kind regards
Mike
--
Mike Rötgers
http://www.roetgers.org