PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #3758

custom error message for callback rules

Details

Request #3758custom error message for callback rules
Submitted2005-03-09 18:40 UTC
Fromstevec at engr dot orst dot edu
StatusNo Feedback
PackageHTML_QuickForm
PHP VersionIrrelevant
OSany
Roadmaps(Not assigned)

Comments

[2005-03-09 18:40 UTC] stevec at engr dot orst dot edu

Description:
------------
For callback custom rules, it would be nice to have the option of taking the return value (if not true or false) and displaying it as the error message.

For instance:

1. If the return value is true, it passes the rule
2. If the return value is false, use the error specified in addRule
3. If any other value, assume false and use the return value as the error message.

Or perhaps only 3 comes into effect if there is no error message defined in addRule.

The application I'm writing right now has a password reset function. I'm using a callback to verify the password passes certain rules. But it would be nice to let the user know why the password failed instead of a generic "password is not secure enough, try again".