Open an iFramed Marketo Form's Follow Up Page in the parent page

Version 7

    In some cases, you may want an iframed Marketo form to open in the parent page.

     

    Note: Please ensure that you have access to an experienced JavaScript developer.

    Marketo Technical Support is not set up to assist with troubleshooting JavaScript.


    Is this article helpful ?

    YesNo


    FORMS 1.0
    Add the following script to the src iframed page within a custom HTML block.


    <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','_top');
       });
    </script>

     


    FORMS 2.0

     

    <script >

    MktoForms2.whenReady(function (form) {

        var form = MktoForms2.getForm(FORM_ID_HERE);

        form.onSuccess(function (values, followUpUrl)

        { window.top.location.href = followUpUrl; return false;

        });

    });

    </script>


    To figure out what the form id is, the easiest way is to look at the embed code. It is the 4 digit number on the second line.