Re: FormBuilder: how to set and keep hidden value - GETTING closer

From: Date: Wed, 05 Jan 2005 19:10:06 +0000
Subject: Re: FormBuilder: how to set and keep hidden value - GETTING closer
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16678@lists.php.net to get a copy of this message
On Wed, 5 Jan 2005 10:58:06 -0800 (PST), l Burnerheimerton <lburnerheimerton@yahoo.com> wrote: > Ok - I changed it to > > function preGenerateForm() { > $this->fb_preDefElements['plot_ID'] = > HTML_QuickForm::createElement('hidden', 'plot_ID', > $_REQUEST['i']); > > Using that, the plot_ID hidden field name shows in the html page but the > value does not. > > Then I changed it to: > > > function preGenerateForm() { > $this->fb_preDefElements['plot_ID'] = > HTML_QuickForm::createElement('hidden', 'plot_ID', > $_REQUEST['plot_ID']); > > and change the URL parameter to plot_ID, it still did not work. Read everything I mentioned on my previous e-mails. I don't have time to hold your hand the whole way. > > > > > Justin Patrin <papercrane@gmail.com> wrote: > > On Wed, 5 Jan 2005 07:39:01 -0800 (PST), l Burnerheimerton > wrote: > > The code below at least gets the value in the html page. But, it does not > send that value to the database. > > > > function preGenerateForm() { > > $this->fb_preDefElements['plot_ID'] = > HTML_QuickForm::createElement('hidden', 'plID', > $_REQUEST['plID']); > > > > I do a var_dump in the function preProcessForm(&$values), and it shows: > > ["plID"]=> string(1) "2" > > ok... you can do 1 of two things. The more corretc one is to change > pllD in that createElement call to be plot_ID. TRY THIS FIRST. If you > absolutely can't get that to work, there's another option. > > It would also be nice if you wouldn't change the subject and such. > This lack of threading is making me respond to this thread too many > times. > > > > > So I need to somehow get that value to go into the database field - > plot_ID > > > > Any ideas? > > > > l Burnerheimerton 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? > > > > function preGenerateForm() { > > $this->fb_preDefElements['plot_ID'] = > HTML_QuickForm::createElement('hidden', 'plID', > $_REQUEST['plID']); > > > > l Burnerheimerton 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 > -- Justin Patrin

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