PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #6834

wrong exportValue of checkbox in group

Details

Submitted2006-02-19 05:03 UTC
Frommarc-bennewitz at arcor dot de
StatusBogus
PackageHTML_QuickForm
PHP Version5.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"
}