Re: Quickform frozen elements
| From: | Jeroen van Vlierden | Date: | Fri, 15 Aug 2003 06:36:55 +0000 |
| Subject: | Re: Quickform frozen elements | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7220@lists.php.net to get a copy of this message | ||
"Alexey Borzov" <borz_off@cs.msu.su> wrote in message
news:3F3C7C81.6070503@cs.msu.su...
> Hi!
>
> Jeroen van Vlierden wrote:
> > I am using the following construction to make sure people don't alter
data
> > which they aren't supposed to alter
> >
> > $form = new HTML_QuickForm('Members', 'POST');
> > $form->addElement('text', 'NUMBER', 'NUMBER');
> > $el = $form->getElement('NUMBER');
> > $el->freeze();
>
> There should be
> $el =& $form->getElement('NUMBER');
>
> or else you are freezing a copy of the element. Besides, do you actually
set the
> elements value somehow?
Yes, sorry, I forgot to put that line of code in the example...
Anyway, thank you so much, your proposed solution works fine.
I should have realized that I needed a reference instead of a copy :-) This
is (as most people will realize) a 'classical' error in c-programming as
well :-)
>
> > or the alternative way
> >
> > $form->addElement('static', 'NUMBER', 'NUMBER');
>
> Static elements do not have submit values. This is the intended behaviour.
>
>