PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #283

grouping a group of checkboxes causes a render error

Details

Submitted2003-11-21 23:11 UTC
Fromrlora at ilatina dot com
StatusWont fix
PackageHTML_QuickForm
PHP Version4.3.1
OSRedhat Linux 7.3
Roadmaps(Not assigned)

Comments

[2003-11-21 23:11 UTC] rlora at ilatina dot com

Description:
------------
Problem: We want to create a matrix of checkboxes, for example, to input a crossword grid.

First we group the checkboxes by row, and then we group all the rows in order to get the grid.

When we render the grid, the last row is repeated. This will cause an extra row in our form with the same form attributes as the last one.

Reproduce code:
---------------
for ($i = 0; $i < 5; $i++) {
$row = array();
for ($j = 0; $j < 5; $j++) {
$row[] = &HTML_QuickForm::createElement('checkbox', "$j");
}
$setOfRowsGrouped[] = &HTML_QuickForm::createElement('group', "$i", ($i + 1).": ", $grid_row);
}
$formObject->addGroup($setOfRowsGrouped, '_frm_grid', 'Label', null, true);

Expected result:
----------------
Result not in HTML:

[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []

The matrix of checkboxes.

Actual result:
--------------
Result not in HTML:

[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []

An extra row is rendered even though the form object dont have this extra row defined. The attributes of this extra row are exactly the same as of the last (correct) row.