Re: Quickform Element Conditional Rule
| From: | Justin Patrin | Date: | Thu, 20 Jan 2005 17:22:37 +0000 |
| Subject: | Re: Quickform Element Conditional Rule | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17044@lists.php.net to get a copy of this message | ||
On Thu, 20 Jan 2005 16:12:03 +0100, Aaron Wormus <aaron@wormus.com> wrote:
> I need to make a clients side validation rule that depends on the state
> of another form element something like:
>
> if (document.form.input1.value == "Hello" && document.test.input2.value
> == ""){
> alert("error");
> }
>
> I know this is easy when the elements are in a group, but these elements
> aren't. Does anyone have some quick code, or an idea of how I can create
> a custom rule for this?
>
Use a form rule with a callback.
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.addformrule.php
> Aaron
>
--
Justin Patrin