AW: [PEAR] [QuickForm] Change look of freezed objects
| From: | Mirco Blitz | Date: | Fri, 10 Dec 2004 10:29:07 +0000 |
| Subject: | AW: [PEAR] [QuickForm] Change look of freezed objects | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16153@lists.php.net to get a copy of this message | ||
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'));
}
Thank you very much for your help.
Mirco Blitz
-----Ursprüngliche Nachricht-----
Von: Justin Patrin [mailto:papercrane@gmail.com]
Gesendet: Donnerstag, 9. Dezember 2004 22:47
An: Mirco Blitz
Cc: pear-general@lists.php.net
Betreff: Re: [PEAR] [QuickForm] Change look of freezed objects
On Thu, 9 Dec 2004 17:57:18 +0100, Mirco Blitz <webmaster@lindworm.de>
wrote:
> Hello,
>
> sometime ago I Asked how to disable checkboxes inside a QF Form.
> You answered that I have to freeze them.
> Now I see the form field like this [] or [x].
> I want to have a disabled checkbox displayed.
>
> Is there a way of doing this. Change the Template or using another method
to
> disable?
Perhaps...
$checkbox->setAttributes(array('disabled' => 'disabled'));
>
> Thank you very much
> Mirco
>
--
Justin Patrin
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php