Reply to SmartyValidate: conditional validation?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация