[SMARTY] SmartyValidate: conditional validation?
Josh Santangelo <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
I have a form in which some fields are required only if the value of other fields is a specific value. For example, a yes/no question which requires more info if "yes" is selected, or a list with an "other" option and a field to specify the other option. What is the best way to validate these additional fields, which are only sometimes required? I've been messing with registering validators for them, then unregistering them before using is_valid(). This works, unless they become required again -- then the validator is no longer registered. Registering them again after using is_valid() does not appear to work. Also posted here: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=6407 thanks, -josh -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php