$ more lib/form/myFormatter.class.php <?php Abstract class myFormatter extends sfWidgetForm { static public function radioTableFormatter ($widgets, $inputs) { $rows = array(); foreach ($inputs as $input) { $rows[] = $widgets->renderContentTag('td', $input['input']); } return $widgets->renderContentTag('span', implode($widgets- >getOption('separator'), $rows), array('class' => $widgets- >getOption('class'))) ; }
static public function radioTableNumberFormatter ($widgets, $inputs) { $rows = array(); foreach ($inputs as $input) { $str = $input['label'] . "<br>" . $input['input'] ; $rows[] = $widgets->renderContentTag('td', $str); } return $widgets->renderContentTag('a', implode($widgets- >getOption('separator'), $rows), array('class' => $widgets- >getOption('class'))); } } in my lib/form/.... class NARCForm extends BaseNARCForm { public function configure() { unset($this['id'],$this['survey_id'],$this['start'],$this['end']); $this->widgetSchema['narc_0100'] = new sfWidgetFormSelectRadio (array('choices' => NARCPeer::$episode, 'formatter' => array('myFormatter','radioTableFormatter'),)); ........ Fro your checkboxes you may have to json_encode and decode the values from the widgets to help with reload and saving. Not sure why the radio buttons aren't working. On Apr 14, 2:15 am, fRAnKEnSTEin <shirkav...@gmail.com> wrote: > Hi, > > Two questions here, any advice will be apreciatted: > > 1- I'm using "sfWidgetFormChoice" in a form. The problem that i'm > having is that i need to place the options tags generated by de widget > into <tr> of a table instead using <ul> that the widget generates by > default. Is there any way of rendering this options tags using <tr></ > tr>? this is the line that generates the options: > > ... > 'rdb_rooms' => new sfWidgetFormChoice(array( 'choices' => array("", > "","",""),'expanded' => true)), > ... > > 2- My second doubt is about form posting, i have a form with some > widgets(options, selects and text inputs) when the user submits the > form and there is any validation error, the form re display the page > and all the widgets display the values entered by the user as well, if > the form does not present any validation problem it redirects to > another page of the site. Now if the user hit the back button of the > browser, the textbox inputs display the values entered by the user > previusly, but all the selects and radios buttons losts it's original > entered value. Why the text inputs conservers the value entered by the > user and the combo+radios does not? > > Regards -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe, reply using "remove me" as the subject.