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 #6243

multiple checkboxes with same name

Details

Submitted2005-12-14 17:23 UTC
Frommike dot hoffman at clippard dot com
StatusWont fix
PackageHTML_QuickForm
PHP Version5.0.4
OSLinux
Roadmaps(Not assigned)

Comments

[2005-12-14 17:23 UTC] mike dot hoffman at clippard dot com

Description:
------------
When using <var>[] in the "name" field post attributes are recognized only in PHP's $_POST[] array and not recognized with $form->exportValues();

$res =& $db->query("select ID, name from test where order by name ");
while($res->fetchInto($row)) {
$formChecks[] = &HTML_QuickForm::createElement('checkbox',
'delete[]', null, $row['name']);
}
$form->addGroup($formChecks, 'a_competitor_delete', null, null,false);

Expected result:
----------------
I was expecting to get
$form->exportValues(); to produce an array such as:
$form = array(2) {
["TargetAccount_ID"]=>
string(1) "2"
["delete"]=>=> Array
(
[0] => 1
[1] => 1
)
}

Actual result:
--------------
$_GET=Array
(
)
$_POST=Array
(
[_qf__TargetAccount_Competitor_Delete] =>
[TargetAccount_ID] => 2
[delete] => Array
(
[0] => 1
[1] => 1
)

[submit] => Array
(
[0] => Delete Competitor
)

)
form=array(1) {
["TargetAccount_ID"]=>
string(1) "2"
}