Contact Form 7
Contact Form 7 redirect not working (8 posts)

  1. 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.

    I can't think of what might be causing the disruption. The only new plugin lately is the re-done Google Analyticator-- could that be messing with getting the Javascript loaded?

    What else could be going on here?


  2. Oh! There was a recent update of CF7! Could that be the source of the problem?

  3. Takayuki Miyoshi
    Plugin Author

    Posted 3 years ago #

  4. 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?

  5. Dave333
    Posted 2 years ago #

    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:

    on_sent_ok: "location.replace('http://www.WEBSITE.com/thankyou.html');"

    Why is the code displaying as a message instead of being run?

  6. 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.

  7. Dave333
    Posted 2 years ago #

    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.

  8. That's great news!

    I'm going to be demo-ing CF7 at a WP Meetup for newbies soon, and odds are one of them will want to do this sort of thing!

    Thanks for sharing back!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.