Hi Christian,I can see you are using Zope2/Five/Plone so I'm not sure how
well my answer applies, but I'll answer anyway :)
I got a similar form working just fine in Zope3. It could be that you are
using a named template implementation and you forgot to display the
view/error_views

If so, you need to have something like this in the page template to actually
display the error..

        <div class="form-status" tal:condition="view/status">
            <div class="summary" tal:content="view/status">
               Form status summary
            </div>
            <ul class="errors" tal:condition="view/errors">
               <li tal:repeat="error view/error_views">
                  <span tal:replace="structure error">Error Type</span>
               </li>
            </ul>
        </div>


HTH
Jesper


On 11/21/07, Christian Klinger <[EMAIL PROTECTED]> wrote:
>
> 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
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to