Re: Question Regarding HTML_QuickForm and Add Group

From: Date: Wed, 31 Dec 2003 19:50:24 +0000
Subject: Re: Question Regarding HTML_QuickForm and Add Group
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9893@lists.php.net to get a copy of this message
Thanks Bertrand Mansion, Is their any other way to display fields on same line ? Is addGroup only way to go ? Thanks Sanjay ----- Original Message ----- From: "Bertrand Mansion" <bmansion@mamasam.com> To: "Sanjay" <sanjay92@hotmail.com>; <pear-general@lists.php.net> Sent: Wednesday, December 31, 2003 1:22 AM Subject: Re: [PEAR] Question Regarding HTML_QuickForm and Add Group <sanjay92@hotmail.com> wrote : > I want to display fields on same line, I have read that we can do with > group but why all group examples uses &HTML_QuickForm::createElement. Is it > not possible to just use with add element > > $form = new HTML_QuickForm('frmTest', 'post'); > $form->addElement('header', 'MyHeader', 'Employee'); > $form->addElement('text', 'Empno', 'Emp Id:'); > $form->addElement('text', 'Ename', 'Name:'); > > How to use addGroup for addElement ? > $form->addGroup(?????) > > I have seen examples like this which uses createElement: > $name['last'] = &HTML_QuickForm::createElement('text', > 'last'); > $name['last']->setSize(30); > $name['first'] = &HTML_QuickForm::createElement('text', > 'first'); > $name['first']->setSize(20); > $form->addGroup($name, 'name', 'Name (last, first):', > ',&nbsp;'); If you want to add a group to your form, the elements composing your group have to be added to your group, not to the form. That's why you use createElement() statically, to create the elements, then addGroup(). Bertrand Mansion Mamasam -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pear.general (#9893) next »