• I would like to use a javascript function in Additional Settings to redirect the user to a new page after 5 seconds. I tried to code this up, but not quite working yet. I want to make sure this code will continue working after you deprecate on_sent_ok.

    function formForward(newPage) {
        setTimeout(function(){
            document.addEventListener( 'wpcf7mailsent', function( event ) {
            location = 'https://example.com/thank-you';
            }
        }, 5000);
    }

    Can you provide some guidance for me. Probably useful for many other folks, too. I use this plugin on about 150 sites — love it!

    Thanks!

    • This topic was modified 7 years, 3 months ago by llevenson.
Viewing 3 replies - 1 through 3 (of 3 total)
  • This goes in your theme’s functions.php, not in the plugin settings.

    Thread Starter llevenson

    (@llevenson)

    galbaras, can I put it in the Additional Settings?? I don’t want all forms to forward to this page. Else, I could wrap it in an IF statement — how do I code “IF formID=”xxxxx”?

    Thanks for your help!
    Larry

    Unfortunately, no ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘on_sent_ok replacement’ is closed to new replies.