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

Request #15298 All checkbox values become 1 after freeze
Submitted: 2008-12-13 03:37 UTC
From: onokazu Assigned:
Status: Verified Package: HTML_QuickForm_altselect (version 1.1.0)
PHP Version: 4.4.9 OS: Mac OSX
Roadmaps: (Not assigned)    
Subscription  


 [2008-12-13 03:37 UTC] onokazu (Kazumi Ono)
Description: ------------ After submitting a form, values of all the selected checkbox elements become 1 when the form is frozen. Maybe related with bug #4564 at http://pear.php.net/bugs/bug.php?id=4564. Can this be fixed in the altselect element? Test script: --------------- Input: <input name="name[]" type="checkbox" value="1" id="qf_934ead" checked="checked" /><label for="qf_934ead">label1</label><br /> <input name="name[]" type="checkbox" value="2" id="qf_841c61" checked="checked" /><label for="qf_841c61">label2</label><br /> <input name="name[]" type="checkbox" value="3" id="qf_3c0a20" checked="checked"/><label for="qf_3c0a20">label3</label> Expected result: ---------------- Frozen: <tt>[x]</tt><input type="hidden" name="name[]" value="1" id="qf_6e4674" /><label for="qf_6e4674">label1</label><br /> <tt>[x]</tt><input type="hidden" name="name[]" value="2" id="qf_63f752" /><label for="qf_63f752">label2</label> <tt>[x]</tt><input type="hidden" name="name[]" value="3" id="qf_63f751" /><label for="qf_63f751">label3</label> Actual result: -------------- Frozen: <tt>[x]</tt><input type="hidden" name="name[]" value="1" id="qf_6e4674" /><label for="qf_6e4674">label1</label><br /> <tt>[x]</tt><input type="hidden" name="name[]" value="1" id="qf_63f752" /><label for="qf_63f752">label2</label> <tt>[x]</tt><input type="hidden" name="name[]" value="1" id="qf_63f751" /><label for="qf_63f751">label3</label>

Comments

 [2008-12-13 03:55 UTC] onokazu (Kazumi Ono)
It seems like that this is because the checkbox element always returns a bool value with the getValue() method. If I commented out this method in the checkbox element class so that it will use the one defined in the parent class, all seems to be working fine. I do not know if this can be fixed in the altselect element class?
 [2009-01-17 07:48 UTC] shangxiao (David Sanders)
Although this is not really the responsibility of this package, it seems like it might be helpful. If you have any patches that you'd like to supply then that would be helpful. Changing to feature request as it's not a problem with this package, but with QF.