is it possible to create subform and displaygroup without fieldset on zend forms?

1.3k Views Asked by At

is it possible to create subform and displaygroup without fieldset on zend forms?

2

There are 2 best solutions below

0
On BEST ANSWER

Why to do this?
This is helpful accessibility feature?

However, You may do this in many ways, e.g. subclassing Zend_Form and setting your own decorators, or using getDecorators(), addDecorator() setDecorators() or removeDecorator() methods.

0
On

Yes it is possible.

You can override the loadDefaultDecorators Zend_Form original method in your particular form like this:

public function loadDefaultDecorators() {
    parent::loadDefaultDecorators();

    // remove the 'fieldset' decorator from all subforms
    $subforms = $this->getSubForms();
    foreach($subforms as $subform) {
        $subform->removeDecorator('Fieldset');
    }

    return $this;
}

This may be helpful when you load subforms dynamically, based on e.g a selected option from a select list. Hope this will help someone.