WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7: Redirect to a Thank You page (17 posts)

  1. andytford
    Member
    Posted 5 years ago #

    Is there a way that I can force a redirect to a Thank You page? I realize I would have to adjust the PHP file. Any idea where, or what line, that would need to be adjusted?

    Thanks in advance ~

  2. rasterfixate
    Member
    Posted 5 years ago #

    I also would like this feature. There doesn't seem to be any way to redirect the form to a 'thank you' page after the form is submitted.

    I posted on the developer website at: http://ideasilo.wordpress.com/2007/04/30/contact-form-7/

    -Tom

  3. mannschaft
    Member
    Posted 5 years ago #

    and the developer replied that it can't be done with his plugin.
    Anyone knows of a (simple) plugin that does support a redirect?

  4. djones101
    Member
    Posted 5 years ago #

    Can you move the message that appears after submitting the form? I would like to move it before the contact form? It seams to be a major flaw that the plugin is not user friendly... Would I re-arrange something in the PHP file? Can you have a pop-up message?

    Thanks All

  5. mactac
    Member
    Posted 5 years ago #

    it's really too bad, I agree - it's a major flaw. It's because of the way it's set up in ajax.

    I'm not sure why the developer said that it cannot be done.... it should be fairly straightforward...

  6. djones101
    Member
    Posted 5 years ago #

    I am not familiar with ajax. I am sure I could dissect it and try to figure it out, but I am using the forms for an insurance site and there are about 100 fields in each form and I have a few forms. Any help would be greatly appreciated. I would think you could redirect when it returns the message. I just do not know how to do it. I would be happy to donate to someone that does.

    Thanks

    Dan

  7. gregbarr23
    Member
    Posted 4 years ago #

    Just to revisit this, I love everything about Contact Form 7 but have to work around this one missing feature ALL the time.

    It's really a pretty poor means of confirming successful submission, and I should be looking for a new form solution. : (

    Just posting this in the hopes that the dev realizes he's got a solution that's one feature away from being great.

  8. onthebeach
    Member
    Posted 4 years ago #

    I just installed the plugin as well and love how easy it is as well as customization of the emails that are sent. The biggest thing missing is the redirect to a thank you page. Plus not all th fields clear on submission.

    One item that would be great is a registered user's info auto filling upon login but I don't want to be pushy.

    Great job.

    p.s. I have tried using cForms. Sure it has a lot more functions but is is way too buggy.

  9. onthebeach
    Member
    Posted 4 years ago #

    sorry, duplicate

  10. gilbir
    Member
    Posted 4 years ago #

    If you're interested in implementing this yourself, here's what I'm doing to show a thank you page:
    Create a page template based on one of your other templates and call it nakedpage.php. Delete every thing above <div id="content">, as well as the div tag itself. Do the same with the end div tag. Of course, keep the php comment at the top and change the name of the template. save it.

    Now create a page in wordpress based on nakedpage template.

    in contact-form-7.js replace the last line of the wpcf7ProcessJson function with
    jQuery("#content").load(data.message);

    now in function ajax_json_echo in wp-contact-form-7.php
    You need to define a $result_page variable which defines the actual url of the result page

    then change
    $echo = '{ mailSent: 1, message: "' . js_escape($this->message($cf, 'mail_sent_ok')) . '", into: "#' . $unit_tag . '", captcha: ' . $captcha . ', quiz: ' . $quiz . ' }';
    to
    $echo = '{ mailSent: 1, message: "' . $result_page . '", into: "#' . $unit_tag . '", captcha: ' . $captcha . ', quiz: ' . $quiz . ' }';

    ... now the hard part is just adding an option to the contact form 7 settings to let you change the $result_page dynamically

  11. Dan Hauk
    Member
    Posted 4 years ago #

    now in function ajax_json_echo in wp-contact-form-7.php
    You need to define a $result_page variable which defines the actual url of the result page

    Can anyone give me information about how to do this, or tell me where I can find it? I've been searching for a while now and don't really know the specific phrasing to get a tutorial or anything. I understand what must be done, but I can't find any information on how to do it. Any help would be greatly appreciated!

  12. tripleelle
    Member
    Posted 4 years ago #

    I found an easy solution on this site http://www.grapethinking.com/wordpress-contact-form-7-plugin-landing-pag. I got rid of the line (93) that shows the success message : wpcf7ResponseOutput.addClass(’wpcf7-mail-sent-ok’);

    and it's working great. I hope the Contact Form 7 developers incorporate this into their next release. It's such a great plugin, except for this flaw.

    hope this helps,
    elle

  13. caphun
    Member
    Posted 4 years ago #

    I realize the last post here is 5 months old but I came across the same problem. I found a "solution" that does not require having to change the plugin code and allows a designated thank you page per form.

    Steps:

    1. login to the admin area
    2. create a new page with your thank you message. ensure you keep a note of the permalink /path/to/thank-you-page/
    3. navigate to the contact form management screen
    4. Expand the Messages box
    5. Under "# Sender's message was sent successfully" add the following js code <script type="text/javascript">jQuery(function($){ window.location.href="/path/to/thank-you-page/"; });</script>

    It's not an ideal solution by any means since the page will refresh and the old page will appear for a second before it redirects to the thank you page. But this is a quick fix without having to dive into the plugin code.

  14. ajita
    Member
    Posted 4 years ago #

    caphum, Thank you. I am really lucky that you picked yesterday to come in here and randomly post this fix. Because of this small act of altruism on your part my life has been made so much easier. Again, thank you.

  15. sedelstein
    Member
    Posted 4 years ago #

    Caphun and ajita,
    When I use the js code the contact form only displays the code where the message thank you is displayed. Any ideas on what I am doing wrong?

  16. ccpowell
    Member
    Posted 4 years ago #

    I'm getting the same result as Sedelstein. Caphun, Ajita, please come back!

  17. njs1970
    Member
    Posted 4 years ago #

    The solution presented by "wordpress_dude" in the post below works for me without editing any plugin code whatsoever.

    http://wordpress.org/support/topic/255321?replies=42

    Make sure that you copy the code precisely.

    HTH

    Cheers

    Nick :o)

Topic Closed

This topic has been closed to new replies.

About this Topic