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

Bug #11047 Checkbox element setChecked() is broken.
Submitted: 2007-05-15 14:37 UTC
From: monstroyer Assigned: avb
Status: Closed Package: HTML_QuickForm (version 3.2.7)
PHP Version: 5.2.1 OS: Windows XP
Roadmaps: 3.2.8    
Subscription  


 [2007-05-15 14:37 UTC] monstroyer (Dac Chartrand)
Description: ------------ When a user unchecks a checkbox element set with setChecked(), the input is ignored and the value is submitted. Test script: --------------- <?php require_once "HTML/QuickForm.php"; $form = new HTML_QuickForm('subscribe'); $form->addElement('checkbox', 'optin', 'Uncheck me!', null, 'checked'); $form->addElement('submit', 'submit', 'Submit'); if ($form->validate()) { echo "<pre>\n"; print_r($form->exportValues()); echo '</pre>'; exit; } $form->display(); ?> Expected result: ---------------- 'optin' checkbox element should be undefined. Actual result: -------------- [optin] => 1

Comments

 [2007-06-03 15:26 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.