Error of embed a form on my domain

  • 2maxsing
    Asked on September 6, 2015 at 11:54 PM

    Dear Sir,

    I have copied the iFrame code form the form as below (yellow):

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotform.me/form/50992242254455" frameborder="0" style="width:100%; height:auto; 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;}};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>

    I only change the height to "auto"

    ====================================================================

    ====================================================================

    And I write the html as below (yellow):

    <!DOCTYPE html>
    <html>
    <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">               
        <title>2B Limited offer</title>

    </head>
    <body>

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotformpro.com/form/50992242254455" frameborder="0" style="width:100%; height:auto; 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;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    </body>
    </html>

     

    Why I can't display my form on my domain?

    P.S. you can see the error picture as attachment, thanks a lot

    Jotform Thread 656029 Screenshot
  • Evren VP of Growth
    Replied on September 7, 2015 at 4:36 AM

    Hi there,

    Looks like you've had change your form url. Thats why you can not display your form on your domain.

    Can you use this code?

    <!DOCTYPE html>

    <html>

    <head>

            <meta charset="UTF-8">

            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">                

        <title>2B Limited offer</title>

    </head> 

    <body>

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotform.me/form/50992242254455" frameborder="0" style="width:100%; height:auto; 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;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    </body>

    </html>

    Please feel free to contact me for further information.

    Thank you!

  • 2maxsing
    Replied on September 7, 2015 at 11:56 PM

    Hi Sir,

    Why when I change the form code from 50992242254455 to 52498629905975, it can't display?

    thanks again!

  • Evren VP of Growth
    Replied on September 8, 2015 at 2:55 AM

    Hi 2maxsing,

    The main reason for not displaying form is that you are trying to use different form domain. As I see, Jotform gave you form.jotform.me/form/50992242254455 but you use form.jotformpro.com/form/50992242254455.

    Please be aware of differentiate between domain names.

    Thank you !

  • 2maxsing
    Replied on September 16, 2015 at 1:08 AM

    HI, Wht still can not embed my form in my domain? Thank you very much

    It shows a error message as my attached photo.

    Error of embed a form on my domain Image 1 Screenshot 20

    This is my script:

    <!DOCTYPE html>

    <html>

    <head>

            <meta charset="UTF-8">

            <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">               

            <title>2B Limited offer</title>

        <script>
              (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
              (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
              m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
              })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
           
              ga('create', 'UA-46863152-1', '2blife.com');
              ga('send', 'pageview');
        </script>

    </head>

    <body>

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotform.me/form/52579273724969" frameborder="0" style="width:100%; height:auto; 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;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    </body>

    </html>

  • Chriistian Jotform Support
    Replied on September 16, 2015 at 4:41 AM

    Hi,

     

    I've checked your website, from your screenshot, but i couldn't find the page with embedded form in it. As I see from your screenshot, the error shows Invalid Form URL that shows the URL below to be used. It means that you should use the jotformpro.com url instead of jotform.me. 

     

    You may try the code below in embedding your form using iFrame embed.

     

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="http://form.jotformpro.com/form/52579273724969" frameborder="0" style="width:100%; height:auto; 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;}};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>

     

    Do let us know if you need further assistance.

     

    Regards.

  • killmeal
    Replied on September 17, 2015 at 12:47 AM

    Dear Sir,

     

    Why I still can't show my page? Thanks a lot!

    My page script:

    <!DOCTYPE html>
    <html>
    <head>
            <meta charset="UTF-8">
        <title>Kill Meal FANS offer [Macau]</title>
            <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
     
      ga('create', 'UA-46863152-3', 'mykillmeal.com');
      ga('send', 'pageview');
     
    </script>

    </head>
    <body>

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotformpro.com/form/52590950729464" frameborder="0" style="width:100%; height:auto; 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;}};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>

    </body>
    </html>

    My page link: http://www.mykillmeal.com/form/game.html

     

    Error of embed a form on my domain Image 1 Screenshot 20

  • Evren VP of Growth
    Replied on September 17, 2015 at 1:13 AM

    Hi killmeal,

    You also need to change form url in iframe source. 

    <iframe id="JotFormIFrame" onDISABLEDload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotform.me/form/52590950729464" frameborder="0" style="width:100%; height:auto; border:none;" scrolling="no"></iframe>

    please change your code with this one.

    I wonder did you change form source url after copying your embed code ? 

    Error of embed a form on my domain Image 1 Screenshot 20

    I checked your embed options to be sure. We gave you form.jotform.me domain, but you used form.jotform.com. Did you make this change with your hand ? I appreciate if you help me.

    Thanks

  • killmeal
    Replied on September 17, 2015 at 2:53 AM

    Hi,

    Thank you for your teaching

    I can show the page,

    but it can not responsive form in all smart phone.

    Can you help me? thanks again!

  • Jan
    Replied on September 17, 2015 at 7:03 AM

    I created a separate thread for the responsive issue so that we can assist you properly. Here's the thread URL: http://www.jotform.com/answers/664090

    Thank you for understanding.