-
leisuretimeAsked on November 22, 2017 at 7:41 AM
Hi - I am trying to embed the form on my website. Using the simple embed code doesn't seem to work. Nothing shows up on the website. Using the Iframe code does show the form on my website but with lots of code showing below the form. See attached picture.
Can you help?
Thanks, Karl
Page URL: http://stscsport.co.uk/devonshire/ -
burak JotForm DeveloperReplied on November 22, 2017 at 9:27 AM
Hello Karl,
I've just checked your situation and found out your web site source code doesn't seem valid.
You should be using this snippet:
<iframe id="JotFormIFrame-50744856639973" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="https://form.jotform.com/50744856639973" frameborder="0" style="width: 1px; min-width: 100%; height:2799px; border:none;" scrolling="no"> </iframe> <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-50744856639973"); if(window.location.href && window.location.href.indexOf("?") > -1) { var get = window.location.href.substr(window.location.href.indexOf("?") + 1); if(ifr && get.length > 0) { var src = ifr.src; src = src.indexOf("?") > -1 ? src + "&" + get : src + "?" + get; ifr.src = src; } } window.handleIFrameMessage = function(e) { var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[2]); } else { 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; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } </script>
Please note missing <script type="text/javascript"> tag between </iframe> and var ifr and
</script> tag between } and </div> in your web site source code.
Hope this helps.
-
karlReplied on November 23, 2017 at 3:56 AM
Hi Burak. Thanks for your advice. I've pasted the code exactly as you have given it to me, but the same problem. Code still showing on the web page. Can you advise? Thanks
-
Chriistian Jotform SupportReplied on November 23, 2017 at 4:08 AM
I checked your site and I noticed that it has not been changed. You still using the invalid source code.
Please follow the suggestion of my colleague or you can try re-embedding the form by copying again the iFrame code: Getting the Form iFrame Code.
Do let us know if you need further assistance.