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 #726

Values submitted with one form, appear on another with similar element names.

Details

Submitted2004-02-10 19:28 UTC
Fromwhiz at skynet dot ie
StatusBogus
PackageHTML_QuickForm
PHP Version4.3.3
OSMandrake Linux 9.2
Roadmaps(Not assigned)

Comments

[2004-02-10 19:28 UTC] whiz at skynet dot ie

Description:
------------
In the code provided, I create two forms, with the following elements:

define('CONSTANT_ONE', 10);
define('CONSTANT_TWO', 20);
...
Form one contains these elements:
$form->addElement('hidden', 'secret', CONSTANT_ONE);
$form->addElement('text', 'number', 'Enter a number:', array('value'=>CONSTANT_ONE));
...
Form two contains these elements:
$form->addElement('hidden', 'secret', CONSTANT_TWO);
$form->addElement('text', 'number', 'Enter a number:', array('value'=>CONSTANT_TWO));

When either of these forms are submitted, the value displayed by the forms is the number submitted by the user, not the value as defined by the constant.

Reproduce code:
---------------
http://www.skynet.ie/~whiz/QFerror.php.gz

Expected result:
----------------
When either of the forms are submitted, the value is displayed to the user. The values in the forms should be those of the constants.

The values of the hidden elements should be different.

Actual result:
--------------
When either of the forms is submitted, the default values displayed is the last value supplied by the user.

The values of the hidden elements are the same. Both 10 or both 20, depending on which form was submitted.