views:

20

answers:

1

Hi all,

I've got a question regarding sub forms.

Currently I've got 2 sub forms and one parent form. On one of the sub forms I want to get data from the model and this needs to be displayed in a table, the first column needs to have a radio button as I want to know which row has been selected. But as a table isn't a form element how can this be done?

Should I drop the sub forms or what do you suggest to do?

Thx!

+2  A: 

I've had a similar issue and ended up adding a radio form element (so no subforms) with a custom view helper.

$this->createElement('radio', 'someRadioButton')
     ->setAttribs( array('helper' => 'formRadioWithTable') );

My view helper extends Zend_View_Helper_FormRadio and defines formRadioWithTable() method, where all the HTML table markup comes up.

Vika