5 Replies Latest reply on Nov 8, 2013 12:11 PM by 923a33e4d4fad7af639a13d354aa935479156ea6

    Form on Non Marketo Page, Load Follow Up URL in IFrame

      I have a page on my website where we are hosting a marketo form in an iFrame. We want to keep the visitor on our website so we created a thank you page for this form on our website. Unfortunately, when someone completes the form the follow up page loads, except it loads in the iFrame and doesn't go to the next page. 

      How do I get the follow up page to load fully on the next page and not in the iFrame?


        • Re: Form on Non Marketo Page, Load Follow Up URL in IFrame
          Julie, you'll need the expertise of someone fluent in JS/jQuery. Here's an article about how to do what you're trying to accomplish: http://stackoverflow.com/questions/580669/redirect-parent-window-from-an-iframe-action-using-javascript
          • Re: Form on Non Marketo Page, Load Follow Up URL in IFrame
            Hello Julie, like Charlie said, it requires a bit of scripting added to the landing page but it's pretty straightfoward. If you have access to someone with scripting experience or if you want to take a stab at it, please see below. We currently have several landing pages with an embedded form hosted within an iframe and this code seems to work great. I'm sure there are other options out there but the script below works well for us.

            1. Edit and add an html element to the Marketo landing page where your form is currently sitting (page hosted in the iframe) and
            2. Edit the newly added html element and add the following code:

            <---- code starts here --->

                 <script type="text/javascript">
                 // setup jQuery.noConflict
                 if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
                   $jQ(document).ready(function() {
                   /* process the form return to parent window*/
                   // Marketo form
                   $jQ('.lpeRegForm').attr('target', '_top');
                        $jQ("input[name='returnURL']").attr('value','replace with thank you url here');  
                        $jQ("input[name='retURL']").attr('value','replace with thank you url here'); 

                 <--- code ends here --->

                 3. Replace 'thank you url here' with the actual redirect url, including http://
                 4. Approve your landing page
                 5. Test, test, test! Happy ifram-ing

                 Basically you're changing the target attribute of the form to "_top" instead of "_self", which is the default. Keep in mind, this script will work as long as the user has Javascript enabled in their browser.

                 The script also works well if you want to open a pdf once the form is submitted instead of redirecting to a thank you page. The url  specified in the code will take precedence over the url value entered in the form's settings.

            • Re: Form on Non Marketo Page, Load Follow Up URL in IFrame
              Karin Edmondson
              I used the folloiwng:

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

                 // all form submits will open in a new window

              I got this from


                   they also have some free templates you can download.

              • Re: Form on Non Marketo Page, Load Follow Up URL in IFrame
                Thanks everyone! Very helpful, we were able to get it fixed.