Re: QuickForm Validation Rule

From: Date: Fri, 22 Apr 2005 21:54:40 +0000
Subject: Re: QuickForm Validation Rule
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-18927@lists.php.net to get a copy of this message
Justin Patrin wrote:
On 4/22/05, Ammar Ibrahim <ammar@gnuix.com> wrote:
How can I add a rule to an element indicating that it is required & must be numeric? I tried the following with no luck, do I need to write a custom rule? $form->addRule('points', 'Hint points must be a number', 'numeric', null,'client');
Looks fine to me. Make sure you're doing that before you display / validate the form. Also, try it as a non-client rule. I fixed it, I added two rules for the element, one for numeric and one for required :)


« previous php.pear.general (#18927) next »