Re: HTML_QuickForm

From: Date: Sat, 23 Feb 2002 01:15:09 +0000
Subject: Re: HTML_QuickForm
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4850@lists.php.net to get a copy of this message
bmansion@mamasam.com (Bertrand Mansion) wrote in news:B871CDB0.9B3%bmansion@mamasam.com: > Hi Brian, > > <brian@onlineinfo.net> wrote : > >> I was working with HTML_QuickForm and have made some minor changes. >> The problem I was having was when calling addElement(). Currently >> this method returns nothing and there is no reference to the object >> you have just created since it is appended to the end of the _elements >> array. I have modified it so that the array addElement() creates >> holds references to the new element object and this array is returned. >> Now I can access the object I have just created easily: >> >> $select = $form->addElement('select','id',null,'Choose'); >> $select['object']->load(dbresult); >> >> I think users of HTML_QuickForm will find this useful. > > Sure. Adam Daniel has written a getElement() method to achieve what you > want. It works like that : > > $form->addElement('select', 'sel', 'Test Select:', > array('A'=>'A', > 'B'=>'B')); > $select = &$form->getElement('sel'); > $select->setSize(5); > $select->setMultiple(true); I look but I can't saw it. Where is this method(getElement)? Thx

« previous php.pear.dev (#4850) next »