[Fwd: Re: [PEAR] QuickForm separator element]
| From: | Demian Turner | Date: | Thu, 10 Apr 2003 10:57:28 +0000 |
| Subject: | [Fwd: Re: [PEAR] QuickForm separator element] | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4770@lists.php.net to get a copy of this message | ||
Hi Bertrand
There is no reason to use a group if those elements are not logically related.The elements I need to group are radio buttons of the same set, I believe they need to be related for this reason.
You might prefer to use addElement and then set a template for those elements you are adding. Or have a look at setting the template for the group and its elements. Or just wait for the IT renderer in release 3.0.Am using Flexy, with DB_Dataobject. Am happy with the default output of the form object as a self-contained table, just need the radio buttons in their own embedded table.
There are many possibilities, it's difficult to answer without knowing exactly what you want to do, which type of groups and elements you use.I'm doing a questionnaire with about 30 multiple choice questions (radio buttons), each one has about 10 options. I have the choices in an assoc array, in this example represented by $this->employment. The code I'm using so far: foreach($this->employment as $index => $element) $radio[] = &HTML_QuickForm::createElement('radio', null, null, $element, $index); $this->form->addGroup($radio, 'u_employment', 'Employment', array('<br />')); $idRadio =& $this->form->getElement('u_employment'); $idRadio->setGroupTemplate('<table border=1><tr>{content}</tr></table>'); $idRadio->setElementTemplate('<td>{element}</td>'); The array is straightforward: $employment = array( 0 => 'Student', 1 => 'Full-time employee', 2 => 'Part-time employee', 3 => 'Self-employed', 4 => 'Retired', 5 => 'Sick/unable to work', 6 => 'Carer', ); Using setGroupTemplate() is it possible to get the contents of the array into two columns? Thanks again for your help, I hope I've explained it clearer this time. cheers, Demian
About the Quickform::updateAttributes() quirk thread, you might want to send me a piece of code so that I can test it... Bertrand Mansion Mamasam-- Demian Turner demian@flameback.com Software Developer tel: +34 91 473 6392 Flameback Solutions http://www.flameback.com