Re: Problems with groups rules in QuickForm
| From: | C.J. Walsh | Date: | Sun, 10 Apr 2005 14:05:34 +0000 |
| Subject: | Re: Problems with groups rules in QuickForm | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18669@lists.php.net to get a copy of this message | ||
check this out:
$str[] = &HTML_QuickForm::createElement('text', '', null,
'size=20');
$str[] = &HTML_QuickForm::createElement('text', '', null,
'size=20');
$form->addGroup($str, 'street', 'Street:', '<br />');
$addr['zip'] = &HTML_QuickForm::createElement('text', 'zip',
'Zip',
'size=6 maxlength=10');
$addr['city'] = &HTML_QuickForm::createElement('text', 'city',
'City',
'size=15');
$form->addGroup($addr, 'address', 'Zip, city:');
$AddrRules['zip'][0] = array('Zip code is required', 'required');
$AddrRules['zip'][1] = array('Zip code is numeric only', 'numeric');
$AddrRules['city'][0] = array('City is required', 'required');
$AddrRules['city'][1] = array('City is letters only', 'lettersonly');
$form->addGroupRule('address', $AddrRules);
Good luck
C.J.
> Found a possible bug, a grouprule wont create a client side check
>
> $form->addGroupRule('name', 'Name is required',
> 'required',null,'client');
>
> $name is an array of firstname and surname.
>
> Any ideas ?
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
CJ Walsh
http://odewebdesigns.com