简体   繁体   中英

How can you disable inline validation for a z3c.form on Plone?

I have a wrapped form that is custom. Inline Validation is having a fit because the javascript runs into error because the input data.errmsg is null and it can't handle that.

It spits out this traceback:

2014-12-16 16:28:15 WARNING plone.protect error parsing dom, failure to add csrf token to  
response for url http://localhost:8080/Plone/.../@@questionsinglepart/@@z3cform_validate_field

For an error in this part of the inline javascript:

   if (fname) {
     $form.ajaxSubmit({
        url: append_url_path($form.attr('action'), '@@z3cform_validate_field'),
        data: {fname: fname, fset: fset},
        iframe: false,
        success: function (data) {
          render_error($field, data.errmsg);
         },
          dataType: 'json'
      });
    }

How can I disable the inline validation for a form so I don't get the errors when it attempts to validate?

可能有更多正式的方法来执行此操作,但是我发现在相关页面(在您的模板中)或全局(在portal_javascripts或通过viewlet)中注入JavaScript一线式解决了我的问题:

$('.z3cformInlineValidation').removeClass('z3cformInlineValidation');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM