I want all the fields to be 100% width all the time

  • Profile Image
    MarketingIQ
    Asked on March 24, 2017 at 03:35 PM

    Hello,

    We are trying to build a fluid form in which the fields are always 100% width. We have tried for several hours, we've looked into the forums and searched on Google, but we are not able to get the fields to be 100% all the time. 

    Please see the two screenshots attached. In one, the forms is perfectly aligned on both sides. On the other, the forms is not aligned at all.

    We have added CSS to change field widths to 100%. We understand our site being fluid affects the form a bit, but shouldn't Jotform's CSS override this issue?

    Please advice.

    Best,

    Esteban

  • Profile Image
    SafaaAbdulhadi
    Answered on March 24, 2017 at 05:57 PM

    Please try adding this custom CSS to your form,

    .form-input, .form-textare, .form-textbox {

    width: 100% !important;

    }

     If you want to add any custom CSS to overwrite your page existing CSS, make sure to use !important as it helps set the priority to the custom CSS. 

    If you need information on how add custom CSS, please refer to this guide:

    How to Inject Custom CSS Codes

     

  • Profile Image
    John_Benson
    Answered on March 24, 2017 at 06:15 PM

    I was able to replicate the issue regarding on the second image you provided. Please give me more time to provide you a custom CSS code. 

    Thank you for your patience.

  • Profile Image
    John_Benson
    Answered on March 24, 2017 at 07:09 PM

    I cloned your form and the issue is fixed after adding the Mobile Responsive widget and the custom CSS code I provided below. Please add the Mobile Responsive widget to your form. Here's how:

    1. Login to your account and open your form.
    2. Go to the Widgets tab and search for Mobile Responsive.
    3. Drag the Mobile Responsive widget to your form.

    After that, inject this custom CSS code to your form: 

    @media only screen and (max-width: 40em) { 

    [data-type="control_dropdown"] .form-input, [data-type="control_dropdown"] .form-input-wide { 

    width: 100% !important; 

    .form-dropdown { 

    max-width: none !important; 

    Here's the guide on: How-to-Inject-Custom-CSS-Codes

    Here's my cloned form: https://form.jotformpro.com/70826980760969. If you want you can clone it. Here's a guide on: How-to-Clone-an-Existing-Form-from-a-URL

    Result:

    Please try it and let us know how it goes. Thank you.