I am needing to be able to modify validation error messages in a very
dynamic way.

I have a form which can be submitted in one of 2 ways.  Either by the
user pressing a custom, named, submit button, or by by an 'onchange'
script if a particular SingleSelectField changes value.

If the form was submitted by the user pressing 'submit' I want any
validation messages to be visible.  But if it is submitted because the
SingleSelectField changed, I want the form to get validated (because I
do want the validation to fail) but I do not want to get all the error
messages on the fields that the user has not filled in yet.

Reinstantiating the form, specifying the new messages dictionary,
doesn't work, since I get a valueError exception complaining that
modifying a widget at that time is not thread safe.

I've also tried something like:

messages=dict(missingValue:"")
my_form.validator.messages = messages

but it ignores it. (And I notice that if I try to print
my_form.validator.messages to stderr it doesn't exist.

What's the right way to do this?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to