Re: [QuickForm] addRule

From: Date: Wed, 29 May 2002 14:04:24 +0000
Subject: Re: [QuickForm] addRule
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1508@lists.php.net to get a copy of this message
le 29/05/02 15:37, talist@vif.com à talist@vif.com a écrit : > Bonjour Bertrand, > > Could you please give an example for a validation rule on an ElementGroup.. > All the examples provided perform validation on addElement fields > > >> Can anybody help on setting and "addRule" onto an "addElementGroup" >> What's wrong with the following code ? >> >> // Creates a group of text inputs >> $areaCode = &HTML_QuickForm::createElement('text', ''); >> $areaCode->setSize(3); >> $areaCode->setMaxLength(3); >> $phoneNo1 = &HTML_QuickForm::createElement('text', ''); >> $phoneNo1->setSize(3); >> $phoneNo1->setMaxLength(3); >> $phoneNo2 = &HTML_QuickForm::createElement('text', ''); >> $phoneNo2->setSize(4); >> $phoneNo2->setMaxLength(4); >> $form->addElementGroup(array($areaCode, $phoneNo1, $phoneNo2), >> 'Telephone:', >> 'Phone', '-'); >> $form->addRule('Phone', 'Phone is incomplete', >> 'required'); I don't think this is implemented yet (Adam, Jason, any ideas ?). Sorry, you will have to do without groups if you want to use addRule (or maybe you have some time to implement it ?). I don't have enough time to do it right now. Bon courage, Bertrand Mansion Mamasam

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