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 #3286

Rules are inconsistent when used with grouped elements

Details

Submitted2005-01-24 21:56 UTC
Fromieure at php dot net
StatusBogus
PackageHTML_QuickForm
PHP Version4.3.9
OSLinux
Roadmaps(Not assigned)

Comments

[2005-01-24 21:56 UTC] ieure at php dot net

Description:
------------
When I add rules to elements inside a group, they don't
work as well as rules with ungrouped elements.

The problems are as follows:

* 'Required' asterisk is only shown for the first element
in the group, not for all required elements.
* The validation error message is only shown for the first
invalid element in the group. All invalid ungrouped
elements have an error message displayed.

I also tried setting the groupElementTemplate to the
regular $_elementTemplate. This makes the required
asterisk show up, but error messages are still only shown
for the first invalid element.

Reproduce code:
---------------
http://atomized.org/PEAR/HTML_QuickForm/grouped.phps
http://atomized.org/PEAR/HTML_QuickForm/ungrouped.phps

Expected result:
----------------
Required notes and validation error messages should be
displayed for all elements, regardless of whether they are
in a group or not.

Actual result:
--------------
Grouped elements do not show whether they are required, or
that they didn't validate.

[2005-02-07 20:20 UTC] ieure at php dot net

I feel that this is bad, in the same way that returning a
blanket 'the form is invalid' message would be for regular
(ungrouped) elements - it's confusing to users, who don't
know what part of the form was invalid.

Would you accept a patch implementing a 'collection'
element, which behaves similarly to the group element, but
retaining the same element behavior as for ungrouped
elements?