Re: HTML_QuickForm
| From: | Bertrand Mansion | Date: | Sat, 23 Feb 2002 13:34:26 +0000 |
| Subject: | Re: HTML_QuickForm | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4852@lists.php.net to get a copy of this message | ||
le 23/02/02 2:15, NoSpam à UVSGXFDUKNTF@spammotel.com a écrit :
> 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)?
It is not committed yet. I think we will have to fork a branch in the CVS to
commit it as it comes with many other changes. Just be patient...
Bertrand Mansion
Mamasam