Edit report at http://pear.php.net/bugs/bug.php?id=17575&edit=1
ID: 17575
Updated by: [email protected]
Reported By: sverel at mail dot ru
Summary: "On empty elements validation" - validation must be
more flexibility.
-Status: Open
+Status: Bogus
Type: Feature/Change Request
Package: HTML_QuickForm2
Operating System: WinXP
Package Version: 0.4.0
PHP Version: 5.2.12
Roadmap Versions:
New Comment:
-Status: Open
+Status: Bogus
Have a look at the builtin-rules.php example file, it contains an
example of that. You
have to use the 'empty' rule and add rules using and_() or or_()
Previous Comments:
------------------------------------------------------------------------
[2010-07-08 21:45:17] sverel
Description:
------------
I try make my feedback form. That form have two fields: phone and
e-mail. No one of them is not required, but user must fill one of them.
If user leave emty both, then error: "u must fill phone _OR_ mail". I
try addRule() to one of the formElement and validate by my callback
function, BUT:
"If the element is empty, no validation rules other than required are
checked for it. This means that empty element can be invalid only when
it is required. "
Becouse both fields is empty, my callback rule doesn't checked and form
is valid.
------------------------------------------------------------------------