简体   繁体   English

联系表格 7 版本 5.2

[英]Contact form 7 version 5.2

I have recently updated my contact form 7 plugin to version 5.7.2.我最近将我的联系表格 7 插件更新到了 5.7.2 版。 Everything is working fine but one thing.一切正常,但有一件事。

I have a form with 4 fields and a privacy checkbox below.我有一个包含 4 个字段和下方隐私复选框的表单。 All fields are mandatory.所有字段都是必填的。 When I click on privacy checkbox without entering anything in above 4 inputs, an error message is displayed.当我在以上 4 个输入中未输入任何内容的情况下单击隐私复选框时,会显示一条错误消息。

I want to remove those validations.我想删除那些验证。 I want to only display errors when the user clicks on the submit button, not on the lost focus of inputs or the checking of box.我只想在用户单击提交按钮时显示错误,而不是在失去输入焦点或选中复选框时显示错误。 I was unable to find a solution.我找不到解决办法。

Can anyone help me here?有人能帮我一下吗?

This is the link to check this issue - https://sawstg.wpengine.com/contact-us/这是检查此问题的链接 - https://sawstg.wpengine.com/contact-us/

I tried to remove the error spans with jquery when the checkbox is clicked, but its not working单击复选框时,我尝试使用 jquery 删除错误范围,但它不起作用

A workaround is to include the following script on your website.解决方法是在您的网站上包含以下脚本。 This will prevent the validation event from triggering when clicking on a checkbox.这将防止在单击复选框时触发验证事件。

$('.wpcf7 input[type="checkbox"]').on("change", function(e) {
  e.stopPropagation();
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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