Re: Some advanced QF and QFC questions ...

From: Date: Wed, 31 Mar 2004 19:14:53 +0000
Subject: Re: Some advanced QF and QFC questions ...
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-26903@lists.php.net to get a copy of this message
Hi! Donald Lobo wrote:
I've gone through the manual and the code a few times and could not find the answers to the below questions. If these "operations" are available great :) if not and we need to enhance the code, we'd be glad to :) 1. Can a "custom" rule return a relevant error message which is specific to the error rather than a generic message: e.g. rather than the msg: "text contined invalid tokens" the msg: "text contined invalid tokens: BAD WORSE WRONG"
With form rules you can return whatever messages you like. With normal rules you set the message when adding the rule and it can't be changed. I don't quite see the use for this, as you usually should describe the valid input values *before* user submits the form, not describe invalid values *after* he submits. Usability, you know. :]
2. Can rules be dependent on each other: e.g. Don't fire the FormRules unless all other rules have been validated?
All the normal rules are run until the first error. Form rules are run in any case 'cause it is impossible now to understand to which elements they apply. I must admit that I understand your point here...
3. Can there be global/section wide error messages?
      e.g. If a Form Rule finds an error applicable to a section of the
form, is there any convenient place to store the error text rather than as the error associated with a specific element?
You can assign the error to e.g. a static element that is the first one in the section. Most renderers also allow collecting all the form's errors into one place.

« previous php.pear.dev (#26903) next »