Re: Quickform validation
| From: | Massimiliano Arione | Date: | Mon, 28 Nov 2005 14:04:53 +0000 |
| Subject: | Re: Quickform validation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22093@lists.php.net to get a copy of this message | ||
Marek Narkiewicz wrote:
Hi there. I have a problem with quickform in that I need a field to be required, only in the event of another field (a select box) being set to a certain value. I made a function to do this and registered it as a rule, but of course this is never used as empty fields are not validated. I can't simply set the field to required as it is only required in certain circumstances. An example of this is a postcode field which is only required in the event of a country select field being set to the value 'UK'. In all other circumstances it is not required. Could anyone suggest a way to do this with quickform? Many thanks.Use addFormRule() instead of addRule() http://pear.php.net/manual/en/package.html.html-quickform.html-quickform.addformrule.php -- Massimiliano Arione http://garakkio.altervista.org