Re: DB_DataObject_FormBuilder & HTML_QuickForm questions with ArraySmarty renderer
| From: | Markus Fischer | Date: | Mon, 29 Aug 2005 07:21:08 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder & HTML_QuickForm questions with ArraySmarty renderer | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39592@lists.php.net to get a copy of this message | ||
Hi Justin,
Justin Patrin wrote:
On 8/24/05, Markus Fischer <markus@fischer.name> wrote:Your advice is to set an option to the FormBuilder to use a customized required message with requiredRuleMessage. Am I wrong that this applies to all required messages? Consider the current problem we're facing: We have a profile for the user to update. The user has two fields "password" and "verify password". If the user just wants update his profile, his password is NOT requred. But, if he wants to change his password, he MUST provide it two times. Again we're using custom callback handlers here. Problem: if the field "password" is filled out and the field "verify password" has NO value, the callback of "verify password" is not executed. Why are custom rules for fields not executed if the field is "not required" and empty? And how can we work around this issue? - Markus* Custom validation rule for fields which are "not null" We've had all "required" fields for the form submission of type "not null". However in this case we were not able to override the default error message ("This field is required"). Calling addRule() simply didn't change anything. Our solution was to change the database to be "null" and then our custom rule was accepted. We mainly needed the custom rules for translated error messages.See: http://opensource.21st.de/23.html#A17