Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.16

Bug #2970 hierselect reset problem
Submitted: 2004-12-15 10:24 UTC
From: aharvey at optimiser dot com Assigned: avb
Status: Closed Package: HTML_QuickForm
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 45 - 17 = ?

 
 [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".

Comments

 [2004-12-28 20:26 UTC] avb
Looks like the form element needs an onreset event handler that will repopulate the options according to hierselect's default values.
 [2005-07-17 19:56 UTC] avb
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.