Bug #17485 [Dup]: Cannot set value submitted by checkbox

From: Date: Mon, 14 Jun 2010 13:24:44 +0000
Subject: Bug #17485 [Dup]: Cannot set value submitted by checkbox
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-3939@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=17485&edit=1 ID: 17485 Updated by: herringm@denison.edu Reported By: herringm at denison dot edu Summary: Cannot set value submitted by checkbox Status: Duplicate Type: Bug Package: HTML_QuickForm Operating System: RHEL4 Package Version: 3.2.11 PHP Version: 5.2.9 Roadmap Versions: New Comment: In QuickForm1 is there any workaround to set the value of a checkbox without resorting to post-processing the results? Both the constructor and HTML_QuickForm_checkbox::setValue() both set user supplied values to 1. I'm using QuickForm in a production environment and would like to have an official patch as it is deployed across more than 5 servers. Previous Comments: ------------------------------------------------------------------------ [2010-06-12 20:30:17] avb -Status: Open +Status: Duplicate Duplicate of request #4564 This was already changed in QuickForm2, won't be changed in QuickForm ------------------------------------------------------------------------ [2010-06-11 21:12:41] herringm Description: ------------ When passing HTML arguments to createElement() "value" is overwritten by the number 1. Attempting to call setValue on the checkbox fails to apply the passed in user parameter. Note: other HTML attributes are correctly applied. Test script: --------------- $person[] =& $form->createElement('text', 'full_name', 'Full Name:', array('size' => 40)); $person[] =& $form->createElement('checkbox', 'element_name', null, null, array('value' => 'Yes', 'title)); $form->addGroup($person, 'person', 'Name:', ' Over 18?'); Expected result: ---------------- <input value="Yes" title="My Tooltip" name="element_name" type="checkbox" id="qf_1662eb" /> Actual result: -------------- <input value="1" title="My Tooltip" name="element_name" type="checkbox" id="qf_1662eb" /> ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=17485&edit=1

« previous php.pear.bugs (#3939) next »