Re: AW: [PEAR] [QuickForm] Change look of freezed objects
| From: | Justin Patrin | Date: | Fri, 10 Dec 2004 20:08:31 +0000 |
| Subject: | Re: AW: [PEAR] [QuickForm] Change look of freezed objects | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16173@lists.php.net to get a copy of this message | ||
On Fri, 10 Dec 2004 22:16:26 +0300, Alexey Borzov <borz_off@cs.msu.su> wrote:
> Mirco Blitz wrote:
>
>
> > Hello Justin,
> > thank you for your answer.
> >
> > When I use the array('disabled' => 'disabled') directly in side the
> > checkbox
> > declaration like in the following, it works fine.
> > $form->addElement('checkbox','r_ben_anl','Benutzer
> > anlegen','',array('disabled' => 'disabled'));
> >
> > But I also tried to set the attribute later, to have a nicer code and no if
> > clauses between the elemt declaration. The nothing is displayed at all.
> > This is my function for setting the attribute later. I think that one is
> > wrong.
> >
> > function disable($name)
> > {
> > global $form;
> > $el =& $form->getElement($name);
> > $el->setAttributes(array('disabled' =>
> > 'disabled'));
>
> Well, after this the following will be displayed as your element:
> <input disabled="disabled" />
>
> That's probably not what you *really* want.
*oops*. Mirco, you want updateAttributes(), not setAttributes().
>
> > }
> >
> > Thank you very much for your help.
> > Mirco Blitz
>
--
Justin Patrin