Re: FormBuilder custom select
| From: | Justin Patrin | Date: | Fri, 16 Sep 2005 17:36:43 +0000 |
| Subject: | Re: FormBuilder custom select | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21010@lists.php.net to get a copy of this message | ||
On 9/16/05, Alessandro Pasotti <ale.pas@tiscali.it> wrote:
> Hello,
>
> Only for fields that are linked to another table, I would like to build a
> select with a <button> that opens a popup to insert a new record and the
> repopulate the <options> in the opener window, js is not the problem here, I
> just don't know how to start, should I subclass HTML_QuickForm_select to add
> the button after the select? Or maybe this can be done manipulating
> FormBuilder's options?
>
> Any hint? (linkNewValue=true works but is too slow for my huge DB)
My original idea for linkNewValue was to have a popup like this but I
ended up not doing this as it would have required a special htdocs
script and I didn't feel like dealing with that right then.
>
> Sould be like this:
>
> -------------------------------------------
> Client: [Choose one...V] or [New value]*
> [Client 1 ]
> [Client 2 ]
> -------------------------------------------
>
> * This opens the popup
>
I recommend doing what I did for FormBuilder. Create your own HTML_QF
element which adds the button and the JS for the button which opens
the new window, then have a special script which displays the form for
the new element and includes the JS to re-inject the option into the
opener's select. If you need help building a new QF element check out
the stuff in DB/DataObject/FormBuilder/QuickForm/. Then ask here if
you still need help.
--
Justin Patrin