PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #4538

addGroupRule() doesn´t care about client-side validation

Details

Submitted2005-06-06 15:33 UTC
Fromsebastian dot goebel at web dot de
Assignedavb
StatusClosed
PackageHTML_QuickForm
PHP Version4.3.1
OSLinux
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!