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_Template_Flexy » Bug #6774

nameuses repeats values for text inputs

Details

Submitted2006-02-13 22:08 UTC
Fromryan at martinibomb dot com
StatusNo Feedback
PackageHTML_Template_Flexy
PHP Version5.0.5
OSWindows XP
Roadmaps(Not assigned)

Comments

[2006-02-13 22:08 UTC] ryan at martinibomb dot com

Description:
------------
using the example nameueses code, if I set 1 of the element's values to something.. and leave the other elements untouched... the value is repeated in the elements that follow.

Test script:
---------------
<?php
$this->data = array();
$elem = array();
$elem['formtest'] = &new HTML_Template_Flexy_Element();
$elem['formtest']->attributes['method'] = 'post';
$elem['formtest']->attributes['action'] = 'test';

for($i = 0; $i < 10; $i++) {
$this->data[$i] = $i;

$elem["data$i"] = new HTML_Template_Flexy_Element();
$elem["data$i"]->attributes['type'] = 'text';
$elem["data$i"]->attributes['size'] = $i;

if ($i == 5) {
$elem["data$i"]->setValue('test');
}

}
$flexy->outputObject($this, $elem);

?>

Expected result:
----------------
I expect that the 5th element, in this case, the 5th text box, has the value 'test' and all other values are blank.

Actual result:
--------------
<html>
<head>
<title>Example of name Uses</title>
</head>
<body>
<form name="formtest"> <span>
1: <input name="data1" type="text" size="1"><br>
</span><span>
2: <input name="data2" type="text" size="2"><br>

</span><span>
3: <input name="data3" type="text" size="3"><br>
</span><span>
4: <input name="data4" type="text" size="4"><br>
</span><span>
5: <input name="data5" type="text" size="5" value="test"><br>
</span><span>

6: <input name="data6" type="text" size="6" value="test"><br>
</span><span>
7: <input name="data7" type="text" size="7" value="test"><br>
</span><span>
8: <input name="data8" type="text" size="8" value="test"><br>
</span><span>
9: <input name="data9" type="text" size="9" value="test"><br>

</span><span>
10: <input name="data10" type="text" size="10" value="test"><br>
</span> </form>
</body>
</html>