Wordpress 更改联系人表格7中的操作
一旦发送邮件,将修改联系人表单7的操作 我跟着做,做得很好。但我的fom处于引导模式,我希望它们在提交时保持打开状态 我的密码是。 函数内PHPWordpress 更改联系人表格7中的操作,wordpress,twitter-bootstrap,contact-form-7,Wordpress,Twitter Bootstrap,Contact Form 7,一旦发送邮件,将修改联系人表单7的操作 我跟着做,做得很好。但我的fom处于引导模式,我希望它们在提交时保持打开状态 我的密码是。 函数内PHP add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); function wpcf7_custom_form_action_url() { return 'http://saviacomunicacion.com.ar/test2014#sala-de-prensa';
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url'); function wpcf7_custom_form_action_url() { return 'http://saviacomunicacion.com.ar/test2014#sala-de-prensa'; }
在传统设置字段中
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
这会重定向URL,但不会发送邮件。
我希望我可以发送邮件并保持模式打开以显示响应:您的邮件发送正确
谢谢根据,还有另一种方法可以完成重定向。只需向插件仪表板添加一些代码。
或者你可以做自定义js函数
在插件选项中
on_sent_ok: "customFunction();"
在代码的某个地方
<script>
function customFunction() {
// show your modal here
$('#myModal').modal();
}
</script>
函数customFunction(){
//在这里显示您的模式
$('#myModal').modal();
}
我找到了使用此代码的解决方案。表单提交时,模式在1秒后关闭。
我没有保持模态打开,而是在关闭后等待1秒,以显示发送的响应
j(".form-horizontal").live("submit", function(){
j.post(this.action, j(this).serialize(), function(){
//this callback is executed upon success full form submission close modal here
}, "script");
//this is to wait 1 second until close
setTimeout(function() {j('.modal').modal('hide');}, 1000);
return false;
});
不工作,页面仍然重新加载,我想发送邮件并保持模态显示,但不重新加载页面。我试过使用这个
j(document).on('mailssent.wpcf7',function(event){event.preventDefault();j('#urlModal').modal();})代码>但不工作