From: ("")
Date:  21 Dec 2015 20:20:36 Hong Kong Time

[PEAR-BUG] Bug #20990 [Com]: Serverside group validation of single elements

NNTP-Posting-Host:  null

Edit report at

 ID:               20990
 Comment by:
 Reported By:      betrazivis at gmail dot com
 Summary:          Serverside group validation of single elements
 Status:           Bogus
 Type:             Bug
 Package:          HTML_QuickForm2
 Operating System: Linux, CentOS
 Package Version:  2.0.2
 PHP Version:      5.6.16
 Roadmap Versions: 
 New Comment:

Ok, now I understand. No serverside validation message by default on
grouped elements. I admit, it took me hours to understand how this
Maybe this could be a feature in next releases ;)
Thank you.

Previous Comments:

[2015-12-14 06:32:53] avb

-Status: Open
+Status: Bogus
That's not exactly a bug, but a shortcoming of default templates for
Default renderer. This is also documented:

What happens is that the rule sets the error for grouped element (and
thus validation fails), but the error is not displayed as there is no
placeholder to do so.


[2015-12-11 06:26:13] betrazivis_2

Validation of elements inside a group is only possible with
CLIENT_SERVER flag, not only with SERVER.

Test script:
$form = new HTML_QuickForm2('Rulestest');

$fsGrouped = $form->addElement('fieldset')->setLabel('Validating grouped
$boxGroup = $fsGrouped->addElement('group', 'boxes')->setLabel('Check at
least two:');
$boxGroup->addElement('checkbox', null, array('value' =>
$text = $boxGroup->addElement('text', 'testUsername', array('style' =>
'width: 200px;'))
                   ->setLabel('Username (letters only):');

$boxGroup->addRule('required', 'Check at least of these', 1,
$text->addRule('required', 'Text is required', null,
$form->addElement('submit', 'testSubmit', array('value' => 'Send'));


$renderer = HTML_QuickForm2_Renderer::factory('default');
// Output javascript libraries, needed for client-side validation
echo $renderer->getJavascriptBuilder()->getLibraries(true, true);
echo $renderer;

Expected result:
A validation result of $text like "CLIENT_SERVER".

Actual result:
No validation message.


Edit this bug report at