Re: QuickForm Error message
| From: | arnaud sellenet bodin | Date: | Thu, 02 Mar 2006 10:49:09 +0000 |
| Subject: | Re: QuickForm Error message | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23199@lists.php.net to get a copy of this message | ||
Le 2 mars 06 à 08:35, cwhisperer a écrit :
Hi, I registered a new rule as well as new function and added the rule as shown in the following snippet: $form->registerRule('chk_reseller_id','function','reseller_id'); $form->addRule('txtreseller','Invalid ResellerID!','chk_reseller_id',null,'client'); It works correct except for the error message which is not shown as javascript alert but in the form. What is wrong?hi if you want your rule to be used with client-side validation, you must create a subclass of HTML_QuickForm_Rule and implement the getValidationScript method (as well as the validate method of course, as server rules are ALWAYS active). In other words if your php validation script is a function, you can only apply it server-side.
Regards A. --PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php