Re: FormBuilder: how to set and keep hidden value - NOT found the answer yet
| From: | l Burnerheimerton | Date: | Wed, 05 Jan 2005 18:45:46 +0000 |
| Subject: | Re: FormBuilder: how to set and keep hidden value - NOT found the answer yet | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16670@lists.php.net to get a copy of this message | ||
Yes, plot_ID is a required field in the database and is in the auto-generated code of the dataobject
class as:
$plot_ID; // int(10) not_null unsigned
so in the database there is a table with this structure:
TABLE
table_ID
plot_ID
otherfields....
thansk for any help
Justin Patrin <papercrane@gmail.com> wrote:
On Wed, 5 Jan 2005 07:10:36 -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.
>
> 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 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
---------------------------------
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.