AnsweredAssumed Answered

Embedded Form Thank You Redirect

Question asked by James Rubin on Oct 7, 2019
Latest reply on Oct 7, 2019 by James Rubin

Hi, 

 

We are using an embedded form on our website. We're testing the form in a 3rd-party pop-up, so it's running simultaneously with a mirror campaign on a Marketo landing page. We'd like to redirect the thank you page back to the standard Marketo thank you page. 

 

Here's the embed code I'm using.

 

MktoForms2.whenReady(function(form){

var formEl = form.getFormElem()[0];

var submitEl = formEl.querySelector('button[type="submit"]');

form.onSuccess(function(vals,tyURL){ 

    var loc = document.createElement('A'); 

    loc.href = tyURL; 

    loc.pathname = [loc.pathname,"thank-you"].join("/"); 

    document.location.href = loc.pathname + loc.search + loc.hash;

 

Any help would be appreciated. Thanks. -J

Outcomes