Home » HTML » HTML_QuickForm » Bug #5549
Select Export Values Issue
Details
| Submitted | 2005-09-28 22:36 UTC |
|---|---|
| From | chris dot yates1 at btconnect dot com |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-09-28 22:36 UTC] chris dot yates1 at btconnect dot com
Description:
------------
HTML_QuickForm 3.2.5
QuickForm/select.php $Id: select.php,v 1.29 2005/07/22 17:30:51 avb Exp $
Using QuickForm_Controller and running the regWizard.php example, the ExportValue function for the select element reports an undefined index $i at line 666
The problem is that _$options is an associative array, so to index into with an integer is incorrect.
Test script:
---------------
QuickForm_Controller example regWizard.php
Here's the fix that worked for me at lines 665 and 666 (original code commented out):
//for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) {
//if ($v == $this->_options[$i]['attr']['value']) {
foreach ($this->_options as $option) {
if ($v == $option['attr']['value']) {
Expected result:
----------------
All submitted values reported.
Actual result:
--------------
Value from select element on second page not included in reported submitted values.