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

hierselect reset problem

Details

Submitted2004-12-15 10:24 UTC
Fromaharvey at optimiser dot com
Assignedavb
StatusClosed
PackageHTML_QuickForm
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-12-15 10:24 UTC] aharvey at optimiser dot com

Description:
------------
(Tested using Firefox 1.0 on Linux.)

1. Create a page including the form listed in the reproduce code.
2. Open the page in a browser and change the value of the first select from "one" to "two". Observe that the second list changes to ("c", "d"), as it should.
3. Click the Reset button.
4. Observe that although the first element has reset to "one", the second element retains the ("c", "d") list and hence hasn't reset to "a", its default.

Reproduce code:
---------------
$first = array('one', 'two');
$second = array(array('a', 'b'),
array('c', 'd'));

$form = new HTML_QuickForm();
$hier = $form->addElement('hierselect', 'hier', 'Hierselect:');
$hier->setOptions(array($first, $second));
$form->addElement('reset', null, 'Reset');
$form->display();

Expected result:
----------------
The two elements within the hierselect should reset to "one", "a".

Actual result:
--------------
The two elements reset to "one", "c".