最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to direct contact form submission to a certain page

programmeradmin0浏览0评论

I have a contact form in wordpress that has an income field which is a drop down. The options are 0-R9999 and R10000+. I have 2 thank you pages. I would like the form to go to a certain thank you page depending on the selection that was made in the drop down.

Any help?

I have a contact form in wordpress that has an income field which is a drop down. The options are 0-R9999 and R10000+. I have 2 thank you pages. I would like the form to go to a certain thank you page depending on the selection that was made in the drop down.

Any help?

Share Improve this question asked May 13, 2019 at 7:34 WebmasterWebmaster 11 bronze badge 1
  • Third party plugins are off-topic here. Please consult the support forum. – nmr Commented May 13, 2019 at 13:18
Add a comment  | 

1 Answer 1

Reset to default 0

If you're okay with paying for a plugin, here's one that does exactly what you need:
https://querysol/product/contact-form-7-redirection/

Otherwise you need to write some code yourself, the documentation is here:
https://contactform7/redirecting-to-another-url-after-submissions/

The code itself needs to be extended a bit, e.g.

<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
    if (jQuery('#yourdropdown').val() == '0') {
        location = 'http://example1/';
    } if (jQuery('#yourdropdown').val() == 'R9999') {
        location = 'http://example2/';
    }
}, false );
</script>
发布评论

评论列表(0)

  1. 暂无评论