PEAR::HTML_QuickForm addRule
| From: | Talist | Date: | Wed, 29 May 2002 04:03:46 +0000 |
| Subject: | PEAR::HTML_QuickForm addRule | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1495@lists.php.net to get a copy of this message | ||
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');