Forums

[Plugin: Contact Form 7] Redirect to a page after form succesful (13 posts)

  1. neslot007
    Member
    Posted 2 years ago #

    Hi there,

    I would like the page to redirect to a specific URL once the user clicks on submit. Any help would be great.

    Thanks,
    Toby

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

  2. reganstar
    Member
    Posted 2 years ago #

    You can try using a 3rd party contact form service like 123 Contact Form. If I remember correctly, you can setup your form to redirect to a certain page after submission.

  3. crossedgenres
    Member
    Posted 2 years ago #

    On the settings page for the plugin, go down to the Additional Settings section (all the way at the bottom) and enter this:

    on_sent_ok: "location.replace('YOUR URL');"

    Changing YOUR URL to wherever you want it to redirect to. It should work exactly how you want.

  4. evelester
    Member
    Posted 2 years ago #

    thanks sooooo much!! That is perfect!!!

  5. neslot007
    Member
    Posted 2 years ago #

    crossedgenres you are my hero and i love you.

    Thanks!

    EDIT: Didn't seem to work, how odd!

  6. crossedgenres
    Member
    Posted 2 years ago #

    That's odd, it works perfectly for me. Make sure you didn't accidentally delete a ' from around the URL, or leave a space where there shouldn't be one. And be sure to Save after adding the code.

    Beyond that, I don't know what to tell you. What version of WP and the contact form are you using? I'm using WP 2.8.6 and Contact Form 2.0.7

  7. nickstaroba
    Member
    Posted 2 years ago #

    This is also not working for me. Any ideas?? It's not syntax...

  8. rosebean
    Member
    Posted 2 years ago #

    Same thing, I am using WordPress 2.8.6 and Contact Form 2.0.7 and it still does not work.

  9. fotoblogger
    Member
    Posted 2 years ago #

    I think it's related to the recent update! At least it has worked fine for me for months, but after an update to Contact Form 2.0.7 (and WP 2.8.6) it stopped working.

    Internet Explorer / Safari / FF all give error with reference to the javascript in line 100 position 43, i.e. the "eval" in this line:

    jQuery.each(data.onSentOk, function(i, n) { eval(n) });

    Anyone has an idea? Help much appreciated (as I've really been defending on ContactForm for download of my free e-book)

    Thanks, Peter / fotoblogger.dk

  10. rickydeez
    Member
    Posted 2 years ago #

    Doesn't work, need fix ASAP.

  11. deewilcox
    Member
    Posted 1 year ago #

    I'm having the same problem, now with WP 3.0 and the latest version of CF7. Has anyone found a fix?

  12. koolsol
    Member
    Posted 1 year ago #

    i sorted this by adding the below function in footer.php file

    wp_footer();

    Note wp_footer(); function should be in php tag like:

    <?php wp_footer();?>

  13. koolsol
    Member
    Posted 1 year ago #

    if you want to redirect to success page you urs than you have to edit scripts.js file add the line below 1 == data.mailSent

    like :

    if (1 == data.mailSent) {
    jQuery(data.into).find('form').resetForm().clearForm();
    wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ok');
    location.href="http://www.yourdomain.com/yourthankyoupage";

Topic Closed

This topic has been closed to new replies.

About this Topic