Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Bug #2278 Error in documentation
Submitted: 2004-09-04 11:35 UTC
From: jan at ivtaco dot se Assigned:
Status: Bogus Package: HTML_QuickForm
PHP Version: 5.0.1 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [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.

Comments

 [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...
 [2004-09-04 12:14 UTC] avb
Everything works as expected.