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

Bug #11138 setDefaults sets multiple values selected even if setMultiple(false)
Submitted: 2007-05-25 08:19 UTC
From: suti Assigned: avb
Status: Closed Package: HTML_QuickForm (version 3.2.7)
PHP Version: 4.4.4 OS: Windows XP
Roadmaps: 3.2.8    
Subscription  


 [2007-05-25 08:19 UTC] suti (Zoltan Sutto)
Description: ------------ SetDefaults on a select element will mark '02' and '2' values as selected even dispite of setMultiple(false) on the element. Test script: --------------- $projects = array('*' => '*','01' => '01','02' =>'02' ,'03' =>'03','2' => '2' ); $form = new HTML_QuickForm('frmprojects'); $resz=& $form->addElement('select', 'project', Project: ', $projects); $form->setDefaults('project', '02'); $form->display; Expected result: ---------------- Only the correct value should be selected. <select name="resz"> <option value="*">*</option> <option value="01">01</option> <option value="02" selected="selected">02</option> <option value="03">03</option> <option value="1a">1a</option> <option value="2">2</option> </select> Actual result: -------------- <select name="resz"> <option value="*">*</option> <option value="01">01</option> <option value="02" selected="selected">02</option> <option value="03">03</option> <option value="1a">1a</option> <option value="2" selected="selected">2</option> </select>

Comments

 [2007-05-29 19:48 UTC] avb (Alexey Borzov)
This is similar to bug #10837, probably fixing one bug will fix the other, too...
 [2007-06-03 15:01 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.