Contact Form 7 redirect not working
After months of working properly, a redirect using this code:
on_sent_ok: “location = ‘http://www.mysite.com/thankyou/’;”
in the Advanced settings section of CF7 has stopped working. Upon submit, it just spins it’s processing arrow forever.
What else could be going on here?
Oh! There was a recent update of CF7! Could that be the source of the problem?
Yes. I checked plugins & themes There don’t seem to be any plugin or theme conflicts — the problem is still there even with deactivations.
Just to be clear, the arrow spins forever, but an email IS submitted. (Because the arrow keeps spinning, the users keep repeatedly submitting MANY emails!). But more importantly, the redirect is not taking users to the payment page.
This form & redirect worked fine for 6+ months, and only in the last couple of weeks developed this problem…
Any other ideas?
Did you get anywhere with this bethannon1?
I’ve been struggling with this for a week now without success.
The green box shows and displays the code inside the green box as a message after the message is sent. Instead of presenting the code as a message to the user I want WordPress to actually run the code:
Why is the code displaying as a message instead of being run?
No, I didn’t. Because I was going to be building some complex forms for other clients, I ended up buying a license for Gravity Forms. Sorry I couldn’t be of help.
Well, I just found a very simple solution:
Just add this to the first of the Messages fields in the Contact form, the one titled: “# Sender’s message was sent successfully”:
Your message was sent successfully. <script> location.href="http://www.WEBSITE.com/thankyou.html"; </script>
Enclosing the code in the script tags was all that was required to trigger the code to run. I don’t know why this is required for some installations and not others but it was the only thing that worked for me. I spent over a week, many hours a day trying many different approaches, including some very complicated hacks. This simple code is the only thing that has worked so far for me.
- The topic ‘Contact Form 7 redirect not working’ is closed to new replies.