Skip to main content
Dan_Stevens_
Level 10
Feb 11, 2014 1:43 AM UTC
Question

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!!!
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

8 replies

Feb 11, 2014 5:05 AM UTC
woohoo!
Translate
Jamye_Breidenba
Level 3
Feb 11, 2014 2:22 PM UTC
Thank you for sharing, Dan. And, thank you Marketo Engineers! You guys are awesome! :)
Translate
Kimi_Heskett1
Level 9
Feb 11, 2014 2:26 PM UTC
Agreed, thank you Marketo!
Translate
Feb 28, 2014 11:31 PM UTC

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');

Translate
Apr 11, 2014 8:06 PM UTC
Thanks, that was super helpful, lifesaver!
Translate
Jun 2, 2014 10:31 PM UTC
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
Translate
Jun 2, 2014 10:34 PM UTC
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
Translate
Level 2
Jul 31, 2014 10:19 AM UTC
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
Translate