Re: HTML_QuickForm: don't understand how to use updateElementAttr

From: Date: Wed, 26 May 2004 17:12:33 +0000
Subject: Re: HTML_QuickForm: don't understand how to use updateElementAttr
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12745@lists.php.net to get a copy of this message
Hi! Robert wrote:
once again: I'm trying to set the attribute "disabled" for a checkbox in a group of checkboxes: ... $c = &HTML_QuickForm::createElement('checkbox', 'school', null, '<span class="chkboxText">Tanzschule</span>'); if($aUserData["has_school"] == 1) $c->setChecked(true); $oForm->updateElementAttr(array("school"), "disabled='disabled'"); $aWeAreACheckbox[] = $c; ... But it doesn't work. What's wrong?
The element wasn't yet added to the form, so the form knows nothing about it. Why not just do: $c->updateAttributes(array('disabled' => 'disabled'));

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