The size of the form is wrong when I use iframe, how do I get it to auto adjust?

  • Profile Image
    Asked on December 11, 2013 at 06:11 AM

    When I embed the form using the sorce code there is no problems and the height of the form will auto adjust with each different page on the form. 

    The problem I have is when I use Iframe to code thats generated is below:


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

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


    I can change the height to a fixed amount but how can I get it to auto adjust? 

  • Profile Image
    Answered on December 11, 2013 at 10:08 AM


    iFrame codes have a fixed height value so I don't that you can auto adjust the size. Since you are using Multi Page form, I would suggest leveling each page so each should contain the same number of fields. This would eliminate extra spaces at the bottom.

    Otherwise, I would suggest the Javascript Method.