V
V
VPVPVP2021-06-12 09:22:31
JavaScript
VPVPVP, 2021-06-12 09:22:31

Redirect not working after submitting contact form7?

There is a site, contact form7 is installed, you need to redirect to another page after sent ok. I installed the Contact form7 redirect
plugin , there is no redirect. Added functions to function.php , same effect

<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
  location = 'http://example.com/';
}, false );
</script>


Tried with
[hidden thankyouURL id:thankyouURL default::// example.com/thank-you/ "/ example.com/thank-you/ "]
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
    var thankyouURL = document.getElementById("thankyouURL").value;
    location = thankyouURL;
}, false );
</script>


The same.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question