What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Embed code is not working

    Asked by jen_harris on April 01, 2016 at 10:17 PM

    Hi There,

     

    Ive created a couple of forms that I wanted to use in my website.  I have set it up correctly with my host (zenfolio) but the code isn't working.  I contacted them and they said there is an issue with a code you have provided me.  Can you help me out with this?  I'm very excited to start using your services! :)

    zenfolio embed embed form iframe embed code
  • Profile Image
    JotForm Support

    Answered by Chriistian on April 02, 2016 at 02:33 AM

    Hi,

     

    I am currently checking your form. I will be back once I find out the problem.

  • Profile Image
    JotForm Support

    Answered by Chriistian on April 02, 2016 at 02:36 AM

    Hi,

     

    If you are referring to this form - http://www.jotform.ca/form/60917813949266, below is the iFrame embed form:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="https://form.jotform.com/60917813949266" frameborder="0" style="width:100%; height:539px; border:none;" scrolling="no"> </iframe> <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; } 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); } if(window.location.href && window.location.href.indexOf("?") > -1) { var ifr = document.getElementById("JotFormIFrame"); 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; } } </script>

     

     

    If you are referring to a different form, please inform us.  For more information about getting the iFrame embed code, please see Getting the Form iFrame Code.

     

    To help you better, please also give us the URL of the webpage where you are embedding your form.

  • Profile Image

    Answered by jen_harris on April 02, 2016 at 07:45 AM
    That worked perfectly! Can you tell me why I don't get that code when I
    click on the Embed code? This is what I get, just a two line code:
    [image: Inline image 1]
    And the website I'm adding it to is www.jenharrisphotography.ca but the
    code you gave me is working perfectly. I just don't know how to get that
    code myself.
    ...
  • Profile Image
    JotForm Support

    Answered by Jan on April 02, 2016 at 08:22 AM

    Unfortunately, the screenshot you posted is not showing.

    The normal embed code are you using script code to get the form to appear on you website. While the iframe code uses iframe element with a script below.

    It is possible that there are conflict between the scripts of the webpage and the form which is why it is not working at first. This will be prevented if you use the Iframe code.

    Thank you.