Doesnt' seem to work with the new version of Sharepoint.

  • t.ho
    Asked on August 4, 2021 at 4:32 AM

    Doesnt' seem to work with the new version of Sharepoint.


    EDIT: Seems to be working with the updated instructions.

  • Basil JotForm Support
    Replied on August 4, 2021 at 8:39 AM

    Hi,

    You should be able to add an embed element in SharePoint and add the code inside it.

    1628080764 610a8a7c2ea0b chrome UccDWym8 Screenshot 10

    Please let us know if you require any further assistance.

  • t.ho
    Replied on August 4, 2021 at 8:27 PM

    Hi Basil,

    That's the web part we used and it's not working.

  • Basil JotForm Support
    Replied on August 5, 2021 at 3:16 AM

    Hi,

    Please copy the code below into you your web part instead of the code from the form:

     <iframe


          id="JotFormIFrame-212152803426043"


          title="Service Request Form"


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


          allowtransparency="true"


          allowfullscreen="true"


          allow="geolocation; microphone; camera"


          src="https://form.jotform.com/212152803426043
          frameborder="
    0"


          width="100%"


          height="1775px"


          style="


          min-width: 100%;


          height:1775px;


          border:none;"



          scrolling="no"


        >



        </iframe>
       


        <script type="text/javascript">


          var ifr = document.getElementById("JotFormIFrame-212152803426043");


          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) {


            if (typeof e.data === 'object') { return; }


            var args = e.data.split(":");


            if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } 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;


              case "loadScript":


                var src = args[1];


                if (args.length > 3) {


                    src = args[1] + ':' + args[2];


                }


                var script = document.createElement('script');


                script.src = src;


                script.type = 'text/javascript';


                document.body.appendChild(script);


                break;


              case "exitFullscreen":


                if      (window.document.exitFullscreen)        window.document.exitFullscreen();


                else if (window.document.mozCancelFullScreen)   window.document.mozCancelFullScreen();


                else if (window.document.mozCancelFullscreen)   window.document.mozCancelFullScreen();


                else if (window.document.webkitExitFullscreen)  window.document.webkitExitFullscreen();


                else if (window.document.msExitFullscreen)      window.document.msExitFullscreen();


                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>


    You will need to replace every occurrence of the numbers "212152803426043" in the code, with your own form ID.

    Please let us know if you face any further issues.

  • t.ho
    Replied on August 5, 2021 at 8:50 PM

    Hmm, that didn't work for us. However, I changed the height to 100% and scrollable to yes, and it seems to be working now.

  • teriskeis
    Replied on August 10, 2021 at 9:10 AM

    The same code is showing up here in my project and I need to clear some questions regarding sharepoint so kindly cooperate with me.
  • Basil JotForm Support
    Replied on August 10, 2021 at 11:12 AM

    Hi @teriskeis,

    I have moved your question to a separate ticket to avoid confusion, please follow up in the link below:

    https://www.jotform.com/answers/3278512

    Thank you.