WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Bet Hannon
    Member
    Posted 1 year ago #

    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?

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Bet Hannon
    Member
    Posted 1 year ago #

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

  3. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

  4. Bet Hannon
    Member
    Posted 1 year ago #

    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
    Member
    Posted 9 months 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. Bet Hannon
    Member
    Posted 9 months ago #

    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
    Member
    Posted 9 months 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. Bet Hannon
    Member
    Posted 9 months ago #

    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

About this Topic

Tags

No tags yet.