Bug #15982 [Opn->Fbk]: trouble with radio-buttons
| From: | daniel dot oconnor at gmail dot com | Date: | Sun, 04 Mar 2012 03:54:53 +0000 |
| Subject: | Bug #15982 [Opn->Fbk]: trouble with radio-buttons | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8352@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=15982&edit=1
ID: 15982
Updated by: daniel.oconnor@gmail.com
Reported By: sandmeier at prodata dot de
Summary: trouble with radio-buttons
-Status: Open
+Status: Feedback
Type: Bug
Package: HTML_QuickForm_ElementGrid
Operating System: all
PHP Version: 5.2.1
Roadmap Versions:
New Comment:
-Status: Open
+Status: Feedback
Thank you for taking the time to report a problem with the package.
This problem may have been already fixed by a previous change that
is in the SVN of the package. Please checking out the SVN
repository of this package and upgrade
svn checkout
svn.php.net/repository/pear/packages/HTML_QuickForm_ElementGrid/trunk
pear upgrade package2.xml
or
pear upgrade package.xml
If you are able to reproduce the bug with the latest SVN,
please change the status back to "Open".
Again, thank you for your continued support of PEAR.
Previous Comments:
------------------------------------------------------------------------
[2009-03-05 15:12:05] ssa
Description:
------------
add two radiobuttons in a row and check for example the first.
Then the exportet value for this button is not 1
but null. If you checked the last, then the exportet value is correct.
Test script:
---------------
<?php
require_once 'HTML/QuickForm/Controller.php';
require_once 'HTML/QuickForm/Action/Display.php';
require_once('HTML/QuickForm/ElementGrid.php');
session_start();
class Page_Account_Credentials extends HTML_QuickForm_Page
{
function buildForm()
{
$this->_formBuilt = true;
$elementGrid = $this->addElement('elementGrid', 'elementGrid',
'Element Grid',false);
$elementGrid->addColumnName('Col2');
$elementGrid->addColumnName('Col3');
$rows = array();
unset($row);
$row = array();
$row[] =
HTML_QuickForm::createElement('radio',"radio1",'radiotest','label1','1');
$row[] =
HTML_QuickForm::createElement('radio',"radio1",'radiotest','label2','2');
$rows[] =& $row;
$elementGrid->setRows($rows);
$buttons[0] =& HTML_QuickForm::createElement('button',
'cancel', 'Cancel');
$buttons[1] =& HTML_QuickForm::createElement('submit',
$this->getButtonName('next'), 'Next step >>');
$this->addGroup($buttons, 'buttons', '', ' ',
false);
$this->setDefaultAction('next');
}
}
class ActionProcess extends HTML_QuickForm_Action
{
function perform(&$page, $actionName)
{
$values = $page->controller->exportValues();
echo "<pre>";
print_r($values);
echo "</pre>";
}
}
$wizard =& new HTML_QuickForm_Controller('regWizard', true);
$wizard->addPage(new Page_Account_Credentials('page1'));
$wizard->addAction('process', new ActionProcess());
$wizard->run();
?>
Expected result:
----------------
when i checked the radiobutton <label1> and click to next, i
would expect to see:
Array
(
[radio1] => 1
)
Actual result:
--------------
but I see:
Array
(
[radio1] =>
)
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=15982&edit=1