Home » HTML » HTML_QuickForm » Bug #6834
wrong exportValue of checkbox in group
Details
| Submitted | 2006-02-19 05:03 UTC |
|---|---|
| From | marc-bennewitz at arcor dot de |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 5.0.4 |
| Roadmaps | (Not assigned) |
Comments
[2006-02-19 05:03 UTC] marc-bennewitz at arcor dot de
Description:
------------
I create a group with checkbox elements. After submit i would get "exportValue" of this group but there i get only checked elements with string values.
Test script:
---------------
$bool = array();
$bool[] = &HTML_Form::createElement('checkbox', 'test1', null, 'test1');
$bool[] = &HTML_Form::createElement('checkbox', 'test2', null, 'test2');
$bool[] = &HTML_Form::createElement('checkbox', 'test3', null, 'test3');
$bool[] = &HTML_Form::createElement('checkbox', 'test4', null, 'test4');
$form->addGroup($bool, 'bool', '');
#
# Submit the form with test3 not checked
#
var_dump($form->exportValue('bool'));
Expected result:
----------------
array(4) {
["test1"] => true,
["test2"] => true,
["test3"] => false,
["test4"] => true
}
Actual result:
--------------
array(3) {
["test1"] => string(1) "1",
["test2"] => string(1) "1",
["test4"] => string(1) "1"
}