Re: HTML_QuickForm field required if not disabled
| From: | Tom Melendez | Date: | Fri, 17 Jun 2005 17:20:33 +0000 |
| Subject: | Re: HTML_QuickForm field required if not disabled | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19668@lists.php.net to get a copy of this message | ||
Hi Justin,
I was looking into this a bit. Does addformrule allow one to do client-
side validation as well?
What about other options? Is there a way I can slip my custom JS code
into the validation function?
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
>
--
====
========================
Tom Melendez
Senior Software Developer
BASCOM Global Internet Services, Inc.
Phone : 631-434-6600
Fax : 631-434-7800
Email : tmelendez@bascom.com
Web : http://www.bascom.com
========================