Re: FormBuilder: how to set and keep hidden value - NOT found the answer yet

From: Date: Wed, 05 Jan 2005 18:38:51 +0000
Subject: Re: FormBuilder: how to set and keep hidden value - NOT found the answer yet
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16669@lists.php.net to get a copy of this message
On Wed, 5 Jan 2005 07:10:36 -0800 (PST), l Burnerheimerton <lburnerheimerton@yahoo.com> wrote: > The code below at least gets the value in the html page. But, it does not send that value to > the database. > > Any ideas? *Is plot_ID a column which is set up in the table?* > > function preGenerateForm() { > $this->fb_preDefElements['plot_ID'] = > HTML_QuickForm::createElement('hidden', 'plID', $_REQUEST['plID']); > > l Burnerheimerton <lburnerheimerton@yahoo.com> wrote: > I was not adding the "fb_" to fieldlables. Once I did, it all worked. > > Justin Patrin > wrote: > On Tue, 4 Jan 2005 21:07:04 -0800 (PST), l Burnerheimerton > 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 > -- Justin Patrin

« previous php.pear.general (#16669) next »