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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [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.