Re: HTML_QuickForm field required if not disabled

From: Date: Fri, 17 Jun 2005 17:32:52 +0000
Subject: Re: HTML_QuickForm field required if not disabled
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19669@lists.php.net to get a copy of this message
On 6/17/05, Tom Melendez <tmelendez@bascom.com> wrote: > Hi Justin, > > I was looking into this a bit. Does addformrule allow one to do client- > side validation as well? I don't think so, no. You can do it by creating yoru own rule class I think.... > > What about other options? Is there a way I can slip my custom JS code > into the validation function? Not AFAIK (aside from creating your own rule class) but I haven't tried this, so I'm not sure. > > Thanks, > > Tom > > > On Thu, 2005-06-16 at 09:55 -0700, Justin Patrin wrote: > > On 6/16/05, Tom Melendez <tmelendez@bascom.com> wrote: > > > Hey folks, > > > > > > Been using quickform for quite a while, and have been pleased with it.. > > > However, I'm running into the following situation: > > > > > > I have fields on the screen that may be required if they are not > > > disabled. (They are disabled based on other choices made on the screen > > > beforehand) How do I tell quickform to "ignore" the require code? > > > > > > > Sounds kind of like the "soft rules" someone proposed a little while > > ago. AFAIK there's no way to actually do this as the submitted form > > has no information as to whether the form elements are disabled or > > not. You'd have to use addFormRule to add a callback which checks the > > other elements and refuses to validate if the required field is nto > > filled out. > > -- Justin Patrin

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