|
QuickForm and Group Rules Again :): msg#00370php.pear.general
Hi list, i'm trying to use efficiently QuickForm, but i'got a trouble :) let's say i have a quickform like this: $form = new HTML_QuickForm(); $group[] =& HTML_QuickForm::createElement('text', 'city'); $group[] =& HTML_QuickForm::createElement('text', 'state'); $group[] =& HTML_QuickForm::createElement('text', 'zip'); $form->addGroup($group, 'city_state_zip', 'City, State, Zip:'); $form->addElement('submit', 'submit'); $address_rules['city'][0] = array('City is required', 'required'); $address_rules['state'][0] = array('State is required.', 'required'); $address_rules['zip'][0] = array('Zip Code is required', 'required'); $form->addGroupRule('city_state_zip', $address_rules); this is one of quickform examples. if i use $form->toArray() i will detect rules and errors on a per group basis. Is there a way to mark the child element of a group with is own error ? for now, if the form is not valid i got: [elements] => Array ( [0] => Array ( [name] => city_state_zip [value] => Array ( [city] => rrr [state] => [zip] => ) [type] => group [frozen] => [label] => City, State, Zip: [required] => 1 [error] => State is required. [separator] => [elements] => Array ( [0] => Array ( [name] => city_state_zip[city] [value] => rrr [type] => text [frozen] => [label] => [required] => [error] => ^^^^^^^^^^^^^^^^^^ [html] => ) And i would like: [elements] => Array ( [0] => Array ( [name] => city_state_zip [value] => Array ( [city] => [state] => [zip] => ) [type] => group [frozen] => [label] => City, State, Zip: [required] => 1 [error] => city is required. [separator] => [elements] => Array ( [0] => Array ( [name] => city_state_zip[city] [value] => [type] => text [frozen] => [label] => [required] => [error] => city is required ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [html] => ) Thanks for your replies Regards Xavier -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: MDB with MS sql server: 00370, Thierry Bothorel |
|---|---|
| Next by Date: | Session expires too fast in LiveUser: 00370, Sonny |
| Previous by Thread: | HTTP - header issue with QFC (again)i: 00370, Barry Steele |
| Next by Thread: | Session expires too fast in LiveUser: 00370, Sonny |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |