[Zope3-Users] Five Formlib and validator

Christian Klinger cklinger at novareto.de
Wed Nov 21 10:44:02 EST 2007


Hi,

i try to make a formlib action with an validator.

My environment is

Zope 2.10.4
Five 1.4.4
plone.app.form branch 2.5

This is my method:


     def validate_change_passwd(self, action, data):
         errors = self.validate(action, data)
         # test password
         from zope.app.form.interfaces import WidgetInputError
         if not errors:
             if data['passwort'] != data['confirm']:
                 errors = WidgetInputError(field_name='passwort', 
widget_title=_(u'Passwort'), errors=_(u'Foo'))
         return errors

     @form.action(_(u'Speichern'), validator=validate_change_passwd)
     def action_resutls(self, action, data):



What do i have to return to display a error message on my form?

I try everything but i don´t get it to work

maybe someone has an tip for me

Christian



More information about the Zope3-users mailing list