FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17575&edit=1

ID: 17575
Updated by: php@mamasam.net
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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 8, '10 at 9:27p
activeJul 8, '10 at 9:27p
posts1
users1
websitepear.php.net

1 user in discussion

Php: 1 post

People

Translate

site design / logo © 2022 Grokbase