Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    DOM Events

    This doc explains how to retrieve data from each user input.

    Frodo

    (@imsosickandtiredofhavingtoregi)

    Hmm, I have the same issue and am wondering if the way to do this is:

    document.addEventListener( ‘wpcf7submit’, function( event ) {
    if ( ‘123’ == event.detail.contactFormId ) {
    alert( “The contact form ID is 123.” )
    location = ‘https://example.com/’;
    // do something productive
    }
    }, false );

    I have been asked to set up 14 thank you pages each with a separate contact form ID. If I use the code above but just change the form id and URL location, will this work?

    Thank you ??

    Has there been an update on this? I, too, have multiple contact-related forms that need to be redirected to different ‘thank you’ pages.

    Hi, i’ve the same problem.
    I’ve tried to add the script to my header.php and in footer.php but it doesn’t work al all on my Divi Theme.

    My deprecated code was:
    on_sent_ok: “var name = $(‘.wpcf7 input[name=name]’).val(); var city = $(‘.wpcf7 select[name=city]’).val(); var newsletter = $(‘.wpcf7 input[name=newsletter]:checked’).val(); location = ‘https://www.mysite.xx/wp-content/themes/Divi/thankyoupage.php?name=’+name+’&city=’+city+’&newsletter=’+newsletter;”

    How can I transform this code?

    MarcellaM,
    Try this plugin. I’ve used it and have been successful.

    Thank you so much!

    I’ve added the script following this topic: append-cf7-form-value-as-variable-to-redirect-url-on-submit

    • This reply was modified 6 years, 11 months ago by MarcellaM.
    • This reply was modified 6 years, 11 months ago by MarcellaM.
    • This reply was modified 6 years, 11 months ago by MarcellaM.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Contact Form 7 – Redirect to Custom URL’ is closed to new replies.