I am trying to modify the html obtained by Zend_Form using decorators.
I want the output HTML to look like this:
<form> <fieldset> <legend>Your Details</legend> <dl> <dt>label etc</dt> <dd>input etc</dd> <dt>label etc</dt> <dd>input etc</dd> </dl> </fieldset> <fieldset> <legend>Address Details</legend> <dl> <dt>label etc</dt> <dd>input etc</dd> <dt>label etc</dt> <dd>input etc</dd> ... etc ... </dl> </fieldset> </form>
I already broke the sections down that I want in certain sets of fields using display groups, for example.
$this->addDisplayGroup(array('name','email','telephone'),'yourdetails'); $yourdetails= $this->getDisplayGroup('personal'); $yourdetails->setDecorators(array( 'FormElements', 'Fieldset' ));
This gives me every section sitting inside a set of fields, but every form element now has no dl wrapping, so I have:
<form> <fieldset> <dt>label etc</dt> <dd>input etc</dd> <dt>label etc</dt> <dd>input etc</dd> </fieldset> ... etc </form>
source share