Re: FormBuilder: how to set and keep hidden value
| From: | Justin Patrin | Date: | Wed, 05 Jan 2005 07:20:07 +0000 |
| Subject: | Re: FormBuilder: how to set and keep hidden value | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16628@lists.php.net to get a copy of this message | ||
On Tue, 4 Jan 2005 21:07:04 -0800 (PST), l Burnerheimerton
<lburnerheimerton@yahoo.com> wrote:
> I need to set a value using a hidden field that is filled with a URL variable retrieved using a
> $_REQUEST[]. It's not the primary key.
>
> The database field is plot_ID. The URL variable is 'plot_ID' - appended to the end
> of the URL.
>
> I finally got it passed so I can see it in the page source using this code in the
> preGenerateForm():
>
> CODE 1:
> $this->fb_preDefElements['plot_ID'] =
> HTML_QuickForm::createElement('hidden', 'pl_ID',
> $_REQUEST['plot_IDent']);
>
> But it not enter that value in the database field, plot_ID
>
> It DID NOT WORK using this code:
>
> CODE 2:
> $this->fb_preDefElements['plot_ID'] =
> HTML_QuickForm::createElement('hidden', 'plot_ID',
> $_REQUEST['plot_IDent']);
>
> Note the difference is the parameter 'hidden' - CODE 1 has the field name and CODE 2
> does not. The CODE 1 show the hidden value on the page before processing. CODE 2 does not.
>
> Any ideas? Thanks!
>
Is plot_ID a column in the table? Do you have it set in
fb_fieldsToRender? How about fb_preDefOrder?
--
Justin Patrin