Re: Quick_Forms - Disable checkbox?

From: Date: Fri, 26 Aug 2005 14:36:38 +0000
Subject: Re: Quick_Forms - Disable checkbox?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20597@lists.php.net to get a copy of this message
Ste wrote:
I'm trying to disable some check boxes on a form as a default when the form is rendered. I'm trying to set the attribute to "disabled" but it doesn't seem to get passed to the check box - at least it doesn't get rendered into HTML with the disabled value. (Radio boxes seem to accept attributes, as I can add an onclick event to my radio box to enable/disable the check boxes as needed.) $list_attrs = array ('disabled' => true);
You should use array('disabled' => 'disabled');
$form->addElement('header', null,'Specific List(s)...?'); $list_options[]=&HTML_QuickForm::createElement('checkbox','own',null,'Items I own',1, $list_attrs);
HTML_QuickForm::createElement('checkbox','own',null,'Items I own', $list_attrs); Notice the lack of "1" parameter: attrs must be the 5th, not the 6th -- Massimiliano Arione :: http://garak.it :: * No Word * http://gnu.org/philosophy/no-word-attachments.html * No HTML * http://efn.no/html-bad.html

« previous php.pear.general (#20597) next »