SOLVED

Form Pre-Populated through Email

Go to solution
Highlighted
Anonymous
Not applicable

Re: Form Pre-Populated through Email

Thanks! I got that to work. However, now I am facing another issue: upon submission of the form, how do I escape the iFrame? We have a Thank you page but that now shows up iFramed 🙂 Is that possible?
Highlighted
Anonymous
Not applicable

Re: Form Pre-Populated through Email

Add this piece of code to the thank you page:

<script language="JavaScript" type="text/javascript">
function breakout_of_frame()
{
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
</script>


And in the template of the thank you page, add the following to the body tag to make sure it triggers:

<body onload="breakout_of_frame()">

As soon as the thank you page opens, it will break out of the iframe. But as you put it in to the template, it will apply to all pages using that temple. Alternatively you can also drag an HTML page element on the landing page with the form and add this code to it.:

<script language="JavaScript" type="text/javascript">
document.getElementById("myFormID").addEventListener("submit",function(){
    return breakout_of_frame();
},false);

</script>

This will let the form break out of the iframe when it's submitted. Not sure if it will work though. But I hope my examples are clear that you can use Javascript to break out of the iframe.