如何在联系表7中添加有关错误的其他设置? [英] How to add additional settings on error in Contact form 7?
问题描述
我已经知道函数"on_sent_ok"在成功提交表单时添加jQuery动作. 但是我想显示一个模式窗口,提醒用户提交错误.有一些功能类似于上面的功能,但是会在出错时被调用吗?
I already know the function 'on_sent_ok' to add jQuery actions when the form is submitted with success. However I want to display a modal window alerting the user when there are submitting erros. There's some function like the one above, but to be called on errors?
推荐答案
在版本3.3中引入了新的jQuery自定义事件触发器:
In version 3.3 new jQuery custom event triggers were introduced:
新功能:引入5个新的jQuery自定义事件触发器(invalid.wpcf7,spam.wpcf7,mailsent.wpcf7,mailfailed.wpcf7,submit.wpcf7).
New: Introduce 5 new jQuery custom event triggers (invalid.wpcf7, spam.wpcf7, mailsent.wpcf7, mailfailed.wpcf7, submit.wpcf7).
请参阅: http://contactform7.com /2012/09/24/contact-form-7-33/#more-2598
您可以像下面的示例一样使用invalid.wpcf7
:
You can use invalid.wpcf7
like the example below:
$(".wpcf7").on('invalid.wpcf7',function(e){
// Launch your modal window here
});
这篇关于如何在联系表7中添加有关错误的其他设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!