Re: QF: Freezing elements

From: Date: Tue, 11 Nov 2003 07:41:48 +0000
Subject: Re: QF: Freezing elements
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8859@lists.php.net to get a copy of this message
Hi! Mike Carter wrote:
I have a form with a date element on it. There is also a checkbox element, and a submit button. When the form first loads I would like to have the date element frozen. How do I define this? I found the freeze() method, but cannot connect the element to the main form object. $entryElement = &HTML_QuickForm::createElement('date', 'entryDate', $this->language['L_InputDate'], array('language' => $_SESSION['_lang'])); $entryElement->freeze(); I do not understand how to add the $entryElement to the $form without adding it in to a Group.
$entryElement = &$form->addElement('date', 'entryDate', $this->language['L_InputDate'], array('language' => $_SESSION['_lang'])); $entryElement->freeze(); addElement() returns a reference to a newly added element. This is even documented.

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