Re: QF - how to do conditional validation of selects?
| From: | Bertrand Mansion | Date: | Thu, 11 Dec 2003 00:24:44 +0000 |
| Subject: | Re: QF - how to do conditional validation of selects? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9468@lists.php.net to get a copy of this message | ||
<grahamc@53tech.com> wrote :
> Hi - I have a QF w/ two select elements, A & B. Users must always select
> an item from A, but are only required to select an item from B if the value
> of A is within a certain range (say A < 4 ). What's the best way to
> implement this in QF?
I'd suggest the use of addFormRule(). See the documentation
http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.add
formrule.php
There is another way that involves addRule(array(A, B), ...) and your own
callback but it's more tricky and we haven't written the docs for that yet.
Your case would make a good example... Feel free to investigate this too.
Bertrand Mansion
Mamasam