Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter taylorcoil

    (@taylorcoil)

    Update: I found a hack-y way to fix it. Add the following:

    <p>
      	<input type="submit" value="Submit" onmouseup="OpenInNewTab()"/>
    </p>
    
    <script>
    function OpenInNewTab() {
      var win = window.open("REDIRECT URL GOES HERE", '_blank');
      win.focus();
    }
    </script>
    Thread Starter taylorcoil

    (@taylorcoil)

    I would really love “new tab” to be an option in the settings for the redirect URL, though ??

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hi Taylor,

    The redirect is a server-side redirect which makes it impossible to open the new URL in a new tab.

    Also, most browsers tend to be very restrictive when it comes to opening new tabs so the best they offer is a new pop-up window inside the context of the current window. Otherwise we’d get 1995 pop-up style invasion all over the internet again.

    If you’re on the premium version (which uses AJAX) then you can actually open a pop-up window for every successful form submission by adding the following code to your form mark-up.

    mc4wp.forms.on('success', function() {
       var win = window.open("REDIRECT URL GOES HERE", '_blank');
      win.focus();
    });

    PS. There are several other form events to hook into.

    I’m afraid that’s really the best we can do here… Sorry.

    Hope that helps. If not, let me know!

    Hi Danny,

    I’m just getting familiar with the premium version of your plugin.

    Where do I put:

    mc4wp.forms.on(‘success’, function() {
    var win = window.open(“REDIRECT URL GOES HERE”, ‘_blank’);
    win.focus();
    });

    To get a pop up on all form submissions?

    Pardon the hijack.

    Thanks.
    Chris

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello christopherheaven,

    The custom code needs to be added at the end of the “functions.php” file in your active theme.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Opening a Redirect URL in a new tab’ is closed to new replies.