How can I reduce the height of the iframe where my form is embedded?

  • Profile Image
    NickGamber
    Asked on January 30, 2015 at 05:36 PM

    Hi,

    Our form is great but when we embed it into our site the height is extreme and it cannot be changed. This seems to be an issue only with the iframe embedding. When we embed the source code this problem with the height goes away. Please let me know if there is anything you can do to fix it. Here is the form on the site.

     

    -Nick Gamber

  • Profile Image
    raul
    Answered on January 30, 2015 at 06:33 PM

    Please try to only use the following embed code:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="https://secure.jotformpro.com/form/50205838709963" frameborder="0" style="width: 100%; height: 800px; border: none;" scrolling="no"></iframe>

    In other words please also remove this part:

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = args[1] + "px";break;case "collapseErrorPage":if (iframe.clientHeight > window.innerHeight) {iframe.style.height = window.innerHeight + "px";}break;case "reloadPage":window.location.reload();break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    You can adjust the height value directly to make the iframe fit your website.

    Let us know if this helps.
    Thank you.

  • Profile Image
    stroudshow
    Answered on January 30, 2015 at 06:40 PM

    I have asked questions on here with no answer?

  • Profile Image
    raul
    Answered on January 30, 2015 at 07:06 PM

    @stroudshow

    We apologize for any delay in providing a response to your questions, we're actively working on providing answers to all the questions in the forum.

    Rest assure that we'll provide you with a response to each of your questions as soon as we can.

    We appreciate your patience.
    Thank you.