Home » HTML » HTML_QuickForm » Bug #2278
Error in documentation
Details
| Submitted | 2004-09-04 11:35 UTC |
|---|---|
| From | jan at ivtaco dot se |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 5.0.1 |
| OS | Windows 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...