Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Dan_Stevens_
Level 10 - Champion Alumni

A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

I would just like to express my sincere appreciation for the Marketo engineers for identifying a solution to the issue those of us have been experiencing when using Forms 2.0 within iFrames on our web pages - specifically the inability for the confirmation page (upon submit) to open in the full window like the legacy forms used to (using specific javascript that Marketo recommended).  My original post can be found here: https://community.marketo.com/MarketoDiscussionDetail?id=90650000000PlLWAA0

Here is the javascript that needs to be placed on the Marketo landing page along with the form:

<script>
   function setupFormSuccess (){
     var form = MktoForms2.getForm(update with form id);
     if(!form){
       setTimeout(setupFormSuccess, 500);
     }else{
       form.onSuccess(function (values, url){
         window.top.location.href = url;
         return false;
       });
     }
   }
   setupFormSuccess();
 </script>


I hope this helpful to others that were previously in a bind like us.  Thanks again Marketo!!!
Tags (1)
8 REPLIES 8
Anonymous
Not applicable

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

woohoo!
Jamye_Breidenba
Level 3

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Thank you for sharing, Dan. And, thank you Marketo Engineers! You guys are awesome! 🙂
Kimi_Heskett1
Level 9 - Champion Alumni

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Agreed, thank you Marketo!
Anonymous
Not applicable

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Just an FYI, this took me a bit of trial and error. The form ID is the numerical part of the id attribute on the <form> tag.

example: mktoForm_1101 - the ID is 1101


So this:

var form = MktoForms2.getForm(update with form id);


Would become this:

var form = MktoForms2.getForm('1101');

Anonymous
Not applicable

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Thanks, that was super helpful, lifesaver!
Anonymous
Not applicable

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Anyone have any issues with IE re this script?  I had heard that there was a problem with cookies on IE with 2.0 and wondering it this is it.

The code works fine on Firefox and Chrome, but will when I clear cache and start a test process on IE (fill out the form, back click and check or hit another link and return) my custom 2.0 welcome back message does not appear, just an unfilled form.

The question for me is whether the cookie is failing or the Welcome Back message but either way it is unfortunate this will not behave on IE like it is on other browsers
Anonymous
Not applicable

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Anyone have any issues with IE re this script?  I had heard that there was a problem with cookies on IE with 2.0 and wondering it this is it.

The code works fine on Firefox and Chrome, but will when I clear cache and start a test process on IE (fill out the form, back click and check or hit another link and return) my custom 2.0 welcome back message does not appear, just an unfilled form.

The question for me is whether the cookie is failing or the Welcome Back message but either way it is unfortunate this will not behave on IE like it is on other browsers
Patricia_Mercha
Level 2

Re: A big SHOUT OUT to the Marketo engineers for fixing a major Forms 2.0 issue with iFrames

Heeeeelp! this does not work for me! I am new to marketo and have followed all the instructions on here and he landing page still open within the iframe. I have tried in both google chrome and EI and although both show different behaviour, they both still open the page within iframe....We have a marketo guru here also and she is totally stumped!


Help would be very much appreciated