JotForm iFrame will not be responsive!

I Really need help with that but first I would thank the founder for this great program it helped me a lot !!!

I tried the last two days just to get this iframe responsive but I don’t really have a plan… on Mac it looks pretty awesome just how we want it but not on my phone

(link where the iframe is implemented)!


Responsive level = 0,0

The Code: (fullscreen is turned on but does not make any difference)

  title="Warme Leads"
  allow="geolocation; microphone; camera"
  min-width: 100%;
<script type="text/javascript">
  var ifr = document.getElementById("JotFormIFrame-201084529927359");
  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 === 'object') { return; }
    var args =":");
    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":
      case "setHeight": = args[1] + "px";
      case "collapseErrorPage":
        if (iframe.clientHeight > window.innerHeight) {
 = window.innerHeight + "px";
      case "reloadPage":
      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';
      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();
    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);

I hope someone can really help me with that.

greetings from Germany :de:

Bootstrap has some embed classes you can apply to make iframes responsive.

The best thing to do is make your own class with the correct ratio to suit. The default bootstrap ones are suited for media.

Hey @Malachiman thanks for your help!

I tried to add the bootstrap code around the iframe but It did not change what did I do wrong ?

<div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="" allowfullscreen=""></iframe></div>

Hey @TeamGoodVibes

Maybe check out this earlier post of mine about how you can setup a responsive iframe. The one you used, uses a ratio of 16:9, The default ones are really suited for media. But you can use the Bootstrap method and make one any ratio you want.

Hey thanks for your answer! But I don’t really get it how I use this bootstrap codes…

I think the problem is that the new iPhones have display ratio of 9:19.5 ??

I tried it with your code but still looks shitty on iPhone :sweat:

I don’t really have a plan how bootstrap works do you have some instructions for me what I exactly have to do?

.embed-responsive-210by297 {
 padding-bottom: 141.42%;
   <div class="embed-responsive embed-responsive-210by297">
     <iframe class="embed-responsive-item" src="">       


do i have to link the bootstrap.css with href in the header of the page ? Blocs does that automatically I guess ? sorry for my dump questions but I don’t have any plan of that… And I really need to get that step done I am wasting so much hours with that…

okay I found someone on from Pakistan who made a code for me

i had to insert it to the header now it works fine :heart_eyes:

   <meta charset="utf-8">
 <meta name="keywords" content="">
 <meta name="description" content=""> 
 <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
 <link rel="shortcut icon" type="image/png" href="../favicon.ico"> 
 <link rel="stylesheet" type="text/css" href="../css/bootstrap.css"> 
  <link rel="stylesheet" type="text/css" href="../style.css"> 
 <link rel="stylesheet" type="text/css" href="../css/animate.css">
 <link rel="stylesheet" type="text/css" href="../css/cookieconsent.min.css"> 
  <link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css"> 
  <link rel="stylesheet" type="text/css" href="../css/feather.min.css"> 
   <link href=',300,400,700,900&display=swap&subset=latin,latin-ext' rel='stylesheet' type='text/css'>