On Jan 17, 2008 3:46 AM, GSP <[EMAIL PROTECTED]> wrote: > > Is it possible to perform conditional validation of form fields? The > documentation states that it is possible to perform complex nested > validation however, I have yet to see an example online or in the > Turbogears book. Basically, my problem is as follows: > > if field_a is not None: > validate field_b. > > Seems rather simple right? There must be an easy way to do this. In > the event that Schema validation does not accommodate this use case, I > am fine with performing the validation manually in the controller > method but I am unsure of how to propagate the error messages back to > the view in a way that the error display will 'just work'(for example > in table forms).
Look at the any and all validators in formencode, they should help in providing more complex logic in your schema validation. http://docs.turbogears.org/1.0/FormValidationWithSchemas --Mark Ramm -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

