|
Posted by Josh Santangelo on 10/12/05 03:10
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
[Back to original message]
|