• Resolved Starhorsepax2

    (@starhorsepax2)


    We are trying to convert a Joomla site to WordPress, and given that this is my most familiar contact form, went with it. The trouble is the old form had a redirect where we could embed several paypal buttons. Since I don’t know of any paypal plugin for contact form 7 that lets you do the ‘multiple options’ thing, I figured I’d have to stick with redirecting to a page with the different buttons (at least for now).

    But the instructions for the redirect are not working for me. I tried these instructions and added the code with the correct URL in the header.php. https://contactform7.com/redirecting-to-another-url-after-submissions/

    Am I missing something? Putting it in the wrong place? All I get is ‘your message has been sent’ instead of the redirect.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You can go to contact form -> edit form ->(look in the top there is some tab form/mail/messages/Additional setting/) go to additional setting -> copy paste this line

    on_sent_ok:”location.replace(‘http://www.example.com’);”

    set your Redirect line on http://www.example.com save that.
    And then in that form submit will take you to your expected link and form will be submitted. You can try this.

    Thread Starter Starhorsepax2

    (@starhorsepax2)

    🙁 Thanks. Just tried it. Still getting the same message. No redirect at all. It did say the function was going to be removed eventually but I don’t get why new code is not working either.

    This metod have to be the better 🙂

    Try and let me know if is working.

    1. Add a new page with Thank You message and save with alias thank-you.

    1. Go to contact form 7 additional setting, paste and save :

    on_sent_ok: “location.replace(‘http://www.xyz.com/thank-you’);”
    <\code>

    Thread Starter Starhorsepax2

    (@starhorsepax2)

    🙁 I already tried that code. Either it still gives message sent or it chokes and never submits. It does say that was being deprecated and I think its already dead.

    Thread Starter Starhorsepax2

    (@starhorsepax2)

    I went ahead and bought a third party plugin that redirects to paypal (after trying the free version here.) The redirect did start working at one point but I have NO idea why it suddenly worked and before it didn’t. It was on a development site with no caching!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Redirect on submit’ is closed to new replies.