PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #2278

Error in documentation

Details

Submitted2004-09-04 11:35 UTC
Fromjan at ivtaco dot se
StatusBogus
PackageHTML_QuickForm
PHP Version5.0.1
OSWindows XP
Roadmaps(Not assigned)

Comments

[2004-09-04 11:35 UTC] jan at ivtaco dot se

Description:
------------
The example on the page:

http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.addgrouprule.php

doesn't work... =/

Reproduce code:
---------------
$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A');
$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B');
$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C');
$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D');
$form->addGroup($checkbox, 'ichkABCD', 'ABCD:', array(' ', '<br />'));
// Simple rule: at least 2 checkboxes should be checked
$form->addGroupRule('ichkABCD', 'Please check at least one box', 'required', null, 2);

Expected result:
----------------
The expected result would be an alert box or something similar stopping the user from submitting the form as the other rules do.

[2004-09-04 11:38 UTC] jan at ivtaco dot se

Just a note: it is the rule that doesn't work. The four checkboxes turn out okej...