Doc #19312 [Opn->Bgs]: hierselect unable to required secondary option
| From: | borz_off at cs dot msu dot su | Date: | Fri, 02 Mar 2012 07:34:19 +0000 |
| Subject: | Doc #19312 [Opn->Bgs]: hierselect unable to required secondary option | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8339@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19312&edit=1
ID: 19312
Updated by: borz_off@cs.msu.su
Reported By: sergiokessler at gmail dot com
Summary: hierselect unable to required secondary option
-Status: Open
+Status: Bogus
Type: Documentation Problem
Package: HTML_QuickForm2
Package Version: 0.6.1
PHP Version: 5.3.4
Roadmap Versions:
New Comment:
-Status: Open
+Status: Bogus
1) Please stop spamming the bug-tracker: subscribe to pear-general
mailing list and ask questions there.
2) Hierselect is a group of two selects, so you should tell the Required
rule that both are required:
...->addRule('required', 'Required value', 2)
That point *is* documented:
http://pear.php.net/manual/en/package.html.html-quickform2.rules.php#package.html.html-quickform2.rules.containers
https://pear.php.net/package/HTML_QuickForm2/docs/0.6.1/HTML_QuickForm2/HTML_QuickForm2_Rule_Nonempty.html#methodsetConfig
Previous Comments:
------------------------------------------------------------------------
[2012-03-02 00:35:42] sak
Description:
------------
hi Alex, sorry to bother you again...
I don't know if this is a bug or not, but if I have a hierselect
like:
$main = array(
'' => '--select style--',
'a' => "Pop",
'b' => "Rock",
'c' => "Classical"
);
$secondary = array(
'' => array('' => '--select author--'),
'a' => array('' => '--select author--', 0 => "Belle
&
Sebastian", 1 => "Elliot Smith", 2 => "Beck"),
'b' => array('' => '--select author--', 3 => "Noir
Desir", 4
=> "Violent Femmes"),
'c' => array('' => '--select author--', 5 =>
"Wagner", 6 =>
"Mozart", 7 => "Beethoven")
);
...
$form->addElement('hierselect', 'testHierselect')
->setLabel('Hierarchical select:')
->loadOptions(array($main, $secondary))
->setSeparator('<br />')
->addRule('required', 'Required value')
;
the required rule has effect only on the main option, if the
secondary option stay on '--select author--' (with empty
value), the validation pass...
maybe I should write a custom rule...
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19312&edit=1