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

Bug #12610 rule required for multiple select
Submitted: 2007-12-04 21:21 UTC
From: kutilm Assigned: avb
Status: Closed Package: HTML_QuickForm2 (version 0.2.0)
PHP Version: 5.2.4 OS: Win
Roadmaps: 0.4.0    

 [2007-12-04 21:21 UTC] kutilm (Michal Kutil)
Description: ------------ Hi, the rule 'required' over select element with multiple choice causes notice. Any items from select field must be selected, in other case no notice is return. Notice: Notice: Array to string conversion in C:\ ... \pear\HTML\QuickForm2\Rule\Nonempty.php on line 67 Test script: --------------- $form = new HTML_QuickForm2('form', 'POST'); $select = $form -> addElement('select', 'fruit', array('multiple' => 'multiple', 'size' => 3), array('label'=>'Fruit', 'options'=>array('apple','orrange','banana','pear'))); $select->addRule('required','Fruit is required!'); $form -> addElement('submit', 'OK'); if ($form->validate()) $form->toggleFrozen(true); echo '<form' . $form->getAttributes(true) . ">\n"; foreach ($form as $element) { output_element($element); } echo '</form>';


 [2009-01-21 21:36 UTC] avb (Alexey Borzov)
Need to add some means to apply existing rules to Containers and multiple selects, like addGroupRule() in old HTML_QuickForm Reference:
 [2009-10-28 15:19 UTC] avb (Alexey Borzov)
-Status: Analyzed +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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. Required / Nonempty rules can now validate <select multiple>'s and Containers
 [2009-11-01 00:29 UTC] angosso (Mbiama Roger)
<IfModule mod_php4.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir ".:/usr/share/php/:/var/www/<hostname>/httpdocs/" </IfModule> <IfModule mod_php5.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir ".:/usr/share/php/:/var/www/<hostname>/httpdocs/" </IdModule>