Form Follow up with to relative external Thank you Page URL | Community
Skip to main content
Prakash_Mohanda
Level 2
June 27, 2018
Question

Form Follow up with to relative external Thank you Page URL

  • June 27, 2018
  • 2 replies
  • 6624 views

Hello

This might be a very simple question. I am basically trying to create form that is being embedded on a web page called 'get-started' but the form should automatically redirect to a relative 'thank you' page that is one level down in the hierarchy 'get-started/thank-you' . How do I setup a redirect to a relative page on the website that this form is located on?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

SanfordWhiteman
Level 10
June 27, 2018

MktoForms2.whenReady(function(form){

  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;

    return false;

  });

});

Prakash_Mohanda
Level 2
June 27, 2018

Thank you Sanford. Where does this code go? or where does this code need to be added?

Prakash_Mohanda
Level 2
June 27, 2018

Currently my ember code is

<script src="//app-ab22.marketo.com/js/forms2/js/forms2.min.js"></script>

<form id="mktoForm_4"></form>

<script>MktoForms2.loadForm("//app-ab22.marketo.com", "876-MVP-978", 4);</script>

Michael_Tucker1
Level 3
August 6, 2018

HI @Prakash Mohandas​,

I think that if you give this code a try instead of your standard Marketo embed form, that should redirect to the landing page you're talking about here:

<script src="//app-ab22.marketo.com/js/forms2/js/forms2.min.js"></script>

<form id="mktoForm_4"></form>

<script>MktoForms2.loadForm("//app-ab23.marketo.com", "876-MVP-978", 4, function(form) {

    form.onSuccess(function(values, followUpUrl) {

        location.href = "https://ibs.schwab.acsitefactory.com/get-started/thank-you";

        return false;

    });

});</script>

Does that help?

Michael

Michael Tucker