Quickform validation
| From: | Marek Narkiewicz | Date: | Mon, 28 Nov 2005 03:58:55 +0000 |
| Subject: | Quickform validation | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22089@lists.php.net to get a copy of this message | ||
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.
Marek