Forms 2.0: iFrame follow-up script no longer works

Dan_Stevens_
Level 10 - Champion Alumni

Re: Forms 2.0: iFrame follow-up script no longer works

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.
Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works

That's a shame. I had just submitted a ticket to try anyways. May I ask why you are using iframes still? We are because we like the ability to add design elements around our forms on the Marketo landing page and the embed doesn't allow us to do this.
Dan_Stevens_
Level 10 - Champion Alumni

Re: Forms 2.0: iFrame follow-up script no longer works

There are some limitations with using the embed code, such as the inability to pre-fill the form fields.  And if I recall, you can't do progressive profiling.  I could be wrong though.
Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works

Dan,

Jumping in here..Basically the form submit function has changed completely. The solution to make his work will require some new code. if you look on our developer site:

http://developers.marketo.com/documentation/websites/forms-2-0/

It's shows some new calls to make things happen, I've  requested our Pm and Eng look in to this feature and others that want to add custom scripts.

So far I've been testing with "form.onSuccess" , keep you posted...
I've been modifying this script not as an embed just the necessary parts in a html block :

//Add an onSuccess handler
  form.onSuccess(function(values, followUpUrl){
    //Take the lead to a different page on successful submit, ignoring the form's configured followUpUrl.
    location.href = "http://whatever.url.you.want/page.html";
    //return false to prevent the submission handler continuing with its own processing
    return false;
  });

Try
window.parent.location.href= "http://www.google.com";





 

Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works


Dan,

This is now resolved, I've updated your test page successfully.

Here's the code(place in a custom html block on the Marketo page) that should be used for iframing Mkto pages/forms .

 

<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>



 

Dan_Stevens_
Level 10 - Champion Alumni

Re: Forms 2.0: iFrame follow-up script no longer works

Don - this is wonderful news (and yes, it does work as intended now).  In fact, I felt the need to start a new community discussion so that it gets the visibility that it deserves.  Thanks so much!!! 

https://community.marketo.com/MarketoDiscussionDetail?id=90650000000PlzWAAS

P.S. - let me know if you'll be attending the Marketo Summit in April.  I owe you a couple of cold ones!!

Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works

Second round is on me! Thank you!
Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works

Just felt the need to thank Don for that code - was beating my head against my desk trying to figure it out using the code at https://community.marketo.com/MarketoResource?id=kA650000000GsRoCAK which doesn't work.
Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works

Don (and the rest of the team that worked on this) thank you so much! I have been pulling my hair out over this for the last week and am so excited to have finally found this post. Wonderful news and fantastic work.

I was in the same boat as John W--looking at some incorrect solutions. Could not be happier for this post.

Cheers!
Anonymous
Not applicable

Re: Forms 2.0: iFrame follow-up script no longer works

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