Re: Trouble getting an external URL to display in Thank You Page after a form submit

Kerry_Productio
Level 2

Re: Trouble getting an external URL to display in Thank You Page after a form submit

So originally we were trying to get to display "Thank You...." in the frame of the iFrame but we've run into SSL certificate issues where it's not set up in our Marketo instance but it is set up on our website so it's calling https when the page is still http.  So I was trying to find a work around in the meantime until we can get our certificate set up. 

I set the external URL in the form itself, not the landing page.

Grégoire_Miche2
Level 10

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Hi Kerry,

As your web site in on https, it is strongly recommended that you do the same for your Marketo instance, for multiple reasons. And one of them is that it will solve your problem

-Greg

Kerry_Productio
Level 2

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Yes we implementing https on our Marketo instance.  It's in process.  Like I said, I was just looking for a temporary solution because right now our Contact Sales form gives you a blank page within the iframe when you submit.  Not ideal. 

Grégoire_Miche2
Level 10

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Hi Kerry,

You could use a Form 2.0 api JS code to hide the form and replace the follow-up page with a simple message.

Look here: Forms 2.0 » Marketo Developers The first example is exactly about this:

MktoForms2.loadForm("//app-sjst.marketo.com", "785-UHP-775", 1057, function(form) {

   // Add an onSuccess handler

  form.onSuccess(function(values, followUpUrl) {

   // Get the form's jQuery element and hide it

  form.getFormElem().hide();

   // Return false to prevent the submission handler from taking the lead to the follow up url

   return false;

   });

});

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Do these two domains share a parent domain (as pages.example.com and www.example.com share example.com)?

If so, this is quite easy.

In the main document:

<script>

     try { document.domain = 'example.com' } catch(e){};

</script>

On your Marketo LP:

<script>

MktoForms2.whenReady(function(form){

    form.onSuccess(function(vals,tyURL){

        try { document.domain = 'example.com' } catch(e){};

        self.parent.document.location = tyURL;

        return false;

    });

});

</script>

Anonymous
Not applicable

Re: Trouble getting an external URL to display in Thank You Page after a form submit

This worked perfect! Thank you.

Kerry_Productio
Level 2

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Thanks for all your input.  I'm still very green with Marketo (taking Foundational Training next week) so I didn't realize that I had to change the redirect on both the Form Template AND the Landing Page that the form was on. I was only changing it on the Form Template. 

Grégoire_Miche2
Level 10

Re: Trouble getting an external URL to display in Thank You Page after a form submit

Hi Kerry,

In fact you do not need to do both.

  1. either you set the redirect you want at the form level and, at the landing page level, you set it to "Form defined"
  2. Or you just set the redirect at landing page level and the form level setting is not relevant

-Greg