Embedding do not work with dreamwaver function

  • Profile Image
    tecnoalex28
    Asked on February 17, 2016 at 03:09 AM
    and embeding do not work with dreamwaver function
  • Profile Image
    Charlie
    Answered on February 17, 2016 at 03:29 AM

    I checked your website page here: http://www.ajunaf.com.ar/congreso_salta.html.

    I see you have embedded the other form using the form's full source code. There's also some scripts and other JS libraries you are loading in your end. I believe this will cause script conflict in your end and would also cause problems if you are embedding two forms in that same page. 

    If you are not adding any custom scripts directly in your form's full source code, then I would strongly suggest using the iFrame embed code on that page. Here's how to get your iFrame embed code: http://www.jotform.com/help/148-Getting-the-Form-iFrame-Code.

    If you are embedding two forms, try removing the other <script> code included on one of your forms iframe embed code. If that causes resizing issues, try removing both the <script> code included in both of your forms. 

    Example:

    Here's my iframe embed code. Noticed that it is composed of an <iframe> tag and a <script> tag. The script tag is responsive for resizing the iFrame tag to make it mobile responsive. If you have two iframes in the same page, that won't cause any problem, however, having two scripts that resizes each iFrame element will cause problems. Which is why I recommend removing the other script or remove them both.

        <iframe

          id="JotFormIFrame"

          onload="window.parent.scrollTo(0,0)"

          allowtransparency="true"

          src="https://form.jotform.com/60471733031951"

          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>

     

    Let us know if that works.