Home » HTML » HTML_QuickForm » Bug #3392
Grouped elements are not accessable directly through exportValue or getElement
Details
| Submitted | 2005-02-07 12:49 UTC |
|---|---|
| From | pear dot php dot net at junk dot rare dot as |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | Irrelevant |
| OS | N/A |
| Roadmaps | (Not assigned) |
Comments
[2005-02-07 12:49 UTC] pear dot php dot net at junk dot rare dot as
Description:
------------
Grouped elements' values are not accessable through HTML_QuickForm::exportValue('element_name')
Grouped elements are not accessable through
HTML_QuickForm::getElement()
This bug seems to be relative to feature request: http://pear.php.net/bugs/bug.php?id=1681
Reproduce code:
---------------
$form = new HTML_QuickForm('quickform');
$arr_grouped_elements = array();
$arr_grouped_elements[] =& HTML_QuickForm::createElement('checkbox','element_name_1',null,'Element 1');
$arr_grouped_elements[] =& HTML_QuickForm::createElement('checkbox','element_name_1',null,'Element 2');
$form->addGroup($arr_grouped_elements, null, 'A group of elements', false);
//line 1
echo var_dump($form->exportValue('element_name_1'));
//line 2
echo var_dump($form->getElement('element_name_2'));
Expected result:
----------------
Line 1: should return the value of the element 'element_name_1'
Line 2: should return the element 'element_name_2'
Actual result:
--------------
line 1: throws QUICKFORM_NONEXIST_ELEMENT
line 2: throws QUICKFORM_NONEXIST_ELEMENT