Vincent-20 wrote:
> 
> Ah, then you'll need to replace the standard decorators [1] with your own
> [2], IIRC.
> 
> [1] http://framework.zend.com/manual/en/zend.form.standardDecorators.html
> [2] http://framework.zend.com/manual/en/zend.form.decorators.html
> -- 
> Vincent
> 
Thanks again, I've RTFM'ed before posting :)
But the answer to my question was not obvious after reading documentation,
at least for me.
The main problem is that we need to "decorate" a group of elements instead
of a single element.
That is when Display Groups comes in handy.
I've created the display group for my two buttons, tweaked their decorators
AND tweaked DisplayGroup's decorators.
The resulting markup is still not as semantically correct as I wanted it,
but it's good enough.

Here is my solution, in case anyone needs it:

// Submit
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Save');
$submit->removeDecorator('DtDdWrapper');
$form->addElement($submit);

// Reset
$reset = new Zend_Form_Element_Reset('reset');
$reset->setLabel('Reset');
$reset->removeDecorator('DtDdWrapper');
$form->addElement($reset);

// Buttons Display Group
$form->addDisplayGroup(array('submit', 'reset'), 'buttons');
$dg = $form->getDisplayGroup('buttons');
$dg->removeDecorator('Fieldset');
$dg->removeDecorator('HtmlTag');
-- 
View this message in context: 
http://www.nabble.com/Zend_Form%3A-submit-and-reset-decorators-tp16234320s16154p16235716.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to