Re: QuickForm and hidden element
| From: | I. M. Bur | Date: | Thu, 11 Nov 2004 16:52:35 +0000 |
| Subject: | Re: QuickForm and hidden element | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15445@lists.php.net to get a copy of this message | ||
> I try to set up a form with QuickForm, but I have a problem with hidden type
> field
>
> I set in the script
> $form_comment->addElement('hidden', 'abc', 50 );
> and
> $form_data.abc.html
>
> I should have : <input name="abc" type "hidden" value="50"
> />
>
> But I have nothing instead.
The third argument is not the one that sets the value, its for
additional attributes of the <input> tag. You have to set the value
using the setValue() method, or using setDefaults() method on the form
itself...
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform-hidden.html-quickform-hidden.php
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform-element.setvalue.php
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.setdefaults.php
--
I. M. Bur
buralien@gmail.com