Forms 2.0: iFrame follow-up script no longer works

Anonymous
Not applicable

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

This is not working for me, but I suspect there's something I'm supposed to do with "update with form id", which is bold in the code, but I don't see anything here stating what I'm supposed to do. Does anyone know?
Anonymous
Not applicable

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

Karen,

You are correct, you need to change that bold section and input the Form ID. The form ID can be found in a couple ways, but the way I always do it is to go to the form in Marketo, select it and look at the URL in your browser. You will need to get the number in the URL that follows "FO" and before the next alphabetical letter.

Example:
  • Form url in MKTO: https://app-abb.marketo.com/#FO1237B2
  • Form ID = 1237
Hope this is clear enough.
Anonymous
Not applicable

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

Thank you. This worked great!
Anonymous
Not applicable

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

Thank you to Don for figuring this out!  If it helps anyone out, I added a line of code to figure out the form ID so I can reuse this without inputing the form number each time.  It just pulls it out of the hidden field where it is stored  here it is...

<script> 
  function setupFormSuccess (){
    var formID = $('[name="formid"]').val();
    var form = MktoForms2.getForm(formID);
 
    if(!form){
 setTimeout(setupFormSuccess, 500);
 
    }else{
 
      form.onSuccess(function (values, url){
 
        window.top.location.href = url;
        return false;
 
      });
    }
  }
  setupFormSuccess();
</script>
Anonymous
Not applicable

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

This is great. Is there any way to grab the URL you want the user redirected to from the hidden field values in the form? I don't want to have to edit this script on every landing page but would rather put it in the landing page template and specify the thank-you page when I drop the form on the landing page.

Since the form is now rendered using javascript, I'm not sure how/where to grab this value. When it was an actual hidden field (i.e. <input type="hidden" name="ret" value="url">) it was easy to grab.

Any info/thoughts are much appreciated.

-Damon