Hold the form fields in one line, unless the width is lower than 700px when each field should have its own line

  • EpicStudio
    Asked on October 30, 2015 at 4:04 AM
    Id like the elements from the same form to ocuppy one line for each element when width is lower than 700px. If you try right now, you will see that they squeeze when width is low until the submit button disapears and is cut from the div.
  • Ben
    Replied on October 30, 2015 at 4:19 AM

    I believe that you want the 700px rule to be when the form is embedded into your website, so based on my check the rules need to be set to the following:

    @media screen and (max-width:768px)
    {
      .form-all > ul {
        margin-left: 0;
        width: 90%;
      }
    }
    @media screen and (max-width:552px)
    {
      li.form-line.form-line-column {
        float: none;
        min-width: 100%;
        padding-bottom: 10px;
        width: 100%;
      }
      button.form-submit-button {
        width: 100%;
      }
    }

    The top rule is just to make it look nicer (centered) as the page is resized, while the second rule will set it to have all fields in their own fields when the width of your website is less than 700px.

    If you want to have the 700px rule applied to the form despite the size of the website, then you should change the 552 (bold) above to 700 before adding the CSS to your form.

    You should follow the next steps to see how to add it: Inject Custom CSS Codes please do only add it after all the other code in there.

    Please do add it and let us know how it looks for you :)

  • EpicStudio
    Replied on October 30, 2015 at 7:03 PM

    Hi Ben, those lines work great, but when responsive mode for mobiles is activated, the form gets a new margin on the right side. I'd like to get rid of it. Should I enter a new line of CSS?

     

    Thanks.

  • EpicStudio
    Replied on October 30, 2015 at 11:28 PM

    I have a second problem too. Iframe height doesn't adjust to form. If I load the webpage on wide width, when I narrow the browser, the form get's cropped by the iframe, but when I load the page on a narrow width and I broaden the browser, the form leaves a space on the bottom of it.

    Is there a way to adjust the iframe's height to the form's height?

     

    Thanks again!

  • victor
    Replied on October 31, 2015 at 10:22 AM

    In regards to your iFrame question, you may adjust the the HEIGHT attribute to 100% or AUTO. This should adjust the height of the iframe that the form is in.

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

    Please let us know if this helps.

  • EpicStudio
    Replied on October 31, 2015 at 2:41 PM

    Thanks Victor. Any idea about the irght margin the form gets when it's on responsive mode? Around 700px or less browser width.
  • abajan Jotform Support
    Replied on October 31, 2015 at 4:54 PM

    Since we strive to keep separate topics in separate threads, I've moved your last question to its own thread (http://www.jotform.com/answers/694796) where it will be addressed in due course.

    Thanks