Home » HTML » HTML_QuickForm » Bug #4538
addGroupRule() doesn´t care about client-side validation
Details
| Submitted | 2005-06-06 15:33 UTC |
|---|---|
| From | sebastian dot goebel at web dot de |
| Assigned | avb |
| Status | Closed |
| Package | HTML_QuickForm |
| PHP Version | 4.3.1 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-06-06 15:33 UTC] sebastian dot goebel at web dot de
Description:
------------
It seems there is a bug in adding client-side validation for group rules.
I used above code to set element 'url' in group 'grp' as required, but a dump of the form object says that this rule is server-side, JS will not addet.
If I manipulate the form-object using the second instruction than it workes fine.
Reproduce code:
---------------
$form->addGroupRule('grp',
array(
'url' => array(
array('Missing URL', 'required')
)
),
NULL,
NULL,
NULL,
'client'
);
$form->_rules['grp[url]'][0][validation] = 'client';
Expected result:
----------------
[_rules] => Array
(
[grp[url]] => Array
(
[0] => Array
(
[type] => required
[format] =>
[message] => Missing URL
[validation] => client
[reset] =>
[group] => grp
)
)
)
Actual result:
--------------
[_rules] => Array
(
[grp[url]] => Array
(
[0] => Array
(
[type] => required
[format] =>
[message] => Missing URL
[validation] => server
[reset] =>
[group] => grp
)
)
)
[2005-06-08 18:27 UTC] sebastian dot goebel at web dot de
Thanks for quick reply!