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

Bug #5615 Checkbox problem after new release of QuickForm
Submitted: 2005-10-06 09:46 UTC
From: bjartekv at gmail dot com Assigned: avb
Status: Closed Package: HTML_QuickForm_Controller
PHP Version: 5.0.4 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-06 09:46 UTC] bjartekv at gmail dot com
Description: ------------ Checkbox values doesnt get checked when you load a previous page where you checked checkboxes. I suspect this happened after installing the latest Quickform release, which had this change. * Other additions and fixes - Added HTML_QuickForm::isSubmitted() method I suspect this check to be the problem in HTML/QuickForm/checkbox.php function onQuickFormEvent($event, $arg, &$caller) ... if ($caller->isSubmitted()) { $value = $this->_findValue($caller->_submitValues); } else { $value = $this->_findValue($caller->_defaultValues); } I fixed this by extending HTML_QuickForm_Page and overriding the loadValues method like this: function loadValues($values) { $this->_flagSubmitted = true; parent::loadValues($values); } dunno if thats the best solution though. Test script: --------------- You can check this by running examples/tabbed.php which wont save the changes when you check some checkboxes.

Comments

 [2005-11-03 20:36 UTC] avb
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.
 [2006-04-21 13:54 UTC] igor dot grzalja at gmail dot com (Igor Grzalja)
The problem about extending loadValues to: function loadValues($values) { $this->_flagSubmitted = true; parent::loadValues($values); } results in unwanted behavior when using modeless controller (eg. tabbed.php). Problem is with required fields (eg. Recite a poem on the Baz tab). After jumping back to tab where required field is you get noticed that that field is required. I think that kind of behavior is not wanted before clicking Big Red Button.