Forms 2.0: iFrame follow-up script no longer works | Community
Skip to main content
Dan_Stevens_
Level 10
January 29, 2014
Question

Forms 2.0: iFrame follow-up script no longer works

  • January 29, 2014
  • 24 replies
  • 3341 views
Many of our Marketo forms are integrated into our website using iFrames.  Prior to Forms 2.0, we placed a small block of javascript code to enable the follow-up page to load in a full window (instead of within the iframe):

<script type="text/javascript" src="/js/public/jquery-latest.min.js"></script>
<script type="text/javascript">
    // set no conflict mode for jquery
  var $jQ = jQuery.noConflict();

  $jQ(document).ready(function(){
      // all form submits will open in a new window
    $jQ('.lpeRegForm').attr('target','_blank');
  });
</script>

I changed the bold line above to:
$jQ('.mktoForm').attr('target','_blank');
to reflect the new form <div> ID that's being used.  But this still isn't working.  Are there any others in this community that have deployed Forms 2.0 using iFrames and have gotten the follow-up page to open in a full window?

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

24 replies

January 29, 2014
Challenge accepted :)
January 29, 2014
Struggling with this one; for some reason the form elements won't accept arguments (or methods...I forget the nomenclature right now)...
January 29, 2014
OK, when Marketo loads their code using the JS embed, they actually load two forms. When I specified my form ID (vs. class of mktoForm which is used twice), it worked in the console:

$('#mktoForm_1005').attr('target','_top');
Dan_Stevens_
Level 10
January 29, 2014
And I belive mktoForm_1005 is a dynamic value (it increases by 1 each time you view the page). 

I also noticed the following code near the bottom of the landing page that contains the form.  Any idea what its purpose might be?:

<div id='lpeCDiv_8960' class='lpeCElement js_for_iframe_window_behavior'><div class='lpContentsItem rawHtmlSpan'>

BTW, 'lpeCDiv_8960' is also dynamic.





January 30, 2014
Try this, it identifies the first form in the code: 

$('.mktoForm').eq(0).attr('target','_top');
Dan_Stevens_
Level 10
January 31, 2014
Jason, unfortunately, this did not work.  Appreciate the persistence though!  BTW, the form is on layer 15 and the custom HTML (javascript) is on layer 14.  Not sure if that has anything to do with it.
Dan_Stevens_
Level 10
February 4, 2014
Hi Jason - were you able to get this to work with your implementation of the form within an iframe?
February 5, 2014
I've yet to put any Forms 2.0 into production yet until they work out the bugs. I'm handy enough with JS that they don't really do anything revolutionary for me at this point.

Call me a form luddite I guess :)
February 7, 2014
Hi Dan- any progress with this? I am running into the same issue.

Thanks!
Dan_Stevens_
Level 10
February 7, 2014
Hi Chrissy.  Unfortunately, no.  Marketo Support is telling us this is our problem to figure out.  We have experienced web developers and javascript experts in-house and even they can't figure it out.  According to them, Marketo is using a bunch on non-traditional techniques within the code, making it very difficult for our team to diagnose.  I'm at a loss right now.  We were really looking forward to migrating all of our forms to the new Forms 2.0 framework.  It doesn't look like that's going to happen anytime soon.