Re: HTML_Quickform and default values
| From: | arnaud sellenet bodin | Date: | Thu, 23 Feb 2006 13:23:08 +0000 |
| Subject: | Re: HTML_Quickform and default values | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23096@lists.php.net to get a copy of this message | ||
HI
Did not try it myself, but I think with a named group you should handle default values this way :
Le 23 févr. 06 à 13:44, Paolo Sala a écrit :$arrDefaults=array([...], '*mygroup*'=>array('daData'=>date('d.m.Y')), [...]);
Hi all, I have a little problem I can't understand with HTML_QuickForm class: how can I set a default value to an element of a named group? If it is no so clear my question I try to explain you using an example. Consider the following code:$arrDefaults=array([...], 'daData'=>date('d.m.Y'), [...]); $form = new HTML_QuickForm('myForm'); $daData[]=&HTML_QuickForm::createElement('text', 'daData', null, $attrData); $form->addGroup($daData, null, 'My date label: '); $form->setDefaults($arrDefaults); $form->display();All works well, the element daData have his default value; but$arrDefaults=array([...], 'daData'=>date('d.m.Y'), [...]); $form = new HTML_QuickForm('myForm'); $daData[]=&HTML_QuickForm::createElement('text', 'daData', null, $attrData); $form->addGroup($daData, '*myGroup*', 'My date label: '); $form->setDefaults($arrDefaults); $form->display();Now the element daData doesn't have his default value. There is a way to put a default value on a element in a named group? Thank you very much. Piviul --PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php