Re: Re: [PEAR] FormBuilder -- add header options to auto-linked select menus
| From: | Justin Patrin | Date: | Thu, 19 Aug 2004 00:34:14 +0000 |
| Subject: | Re: Re: [PEAR] FormBuilder -- add header options to auto-linked select menus | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14176@lists.php.net to get a copy of this message | ||
On Wed, 18 Aug 2004 23:44:24 +0200, Norbert Mocsnik
<pear-general@mocsnik.hu> wrote:
> Justin Patrin wrote:
> > Use something like this in your DataObject class:
> > function postGenerateForm(&$form) {
> > $sel =& $form->getElement('selectElementName');
> > $sel->addOption(...);
> > }
>
> Afaik this will add the option to the end of the list.
> This is why I implemented fb_selectAddEmpty in
> FormBuilder (was it me?) .. that could be improved
> in a future version so it can add arbitrary text as the
> first option to the list.
>
True. If QF doesn't support adding options to the top of the select
box, perhaps this could be added. Shouldn't be too hard.
This is kind of like my moving elements patch that Bertrand refuses to
apply even though is *works perfectly*!
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--