Change Width of a Form Element

  • dpdeleon
    Asked on April 8, 2019 at 4:42 PM

    I would like to make my form horizontal in layout. I have two fields: email and message. I have them aligned horizontally by 'shrinking' the fields and I'd also like them to take up more room on the form. I've tried CSS etc but can't seem to adjust the size of the field to take up more room on the form yet have the two elements remain horizontal. 

    How do I do this?

  • Elton Support Team Lead
    Replied on April 8, 2019 at 6:43 PM

    Inject this CSS code to your form to expand the field in its container. Preview the form afterward to see the result.

    @import url('https://shots.jotform.com/elton/genericTheme.css');

    Guide: How to Inject Custom CSS Codes

    Result:

    Change Width of a Form Element Image 1 Screenshot 20

  • dpdeleon
    Replied on April 9, 2019 at 2:14 PM

    thanks.

    Unfortunately the CSS doesn't work work in all resolutions. When I go to 768 it stacks vertically. Is there a way you can share the CSS so I can see if it can be revised?

  • Nik_C
    Replied on April 9, 2019 at 3:44 PM

    According to my tests, it stacks on 671px width:

    1554838649Screen Shot 2019 04 09 at 9 Screenshot 10

    And it's part of the responsiveness CSS.

    You can try inserting the below CSS:

    @media screen and (max-width: 767px)

    .jotform-form .form-all {

        width: 101%!important;

    }

    That should decrease the width and form will stack on 625px width.

    Let us know if you have any further questions.

    Thank you!

  • dpdeleon
    Replied on April 15, 2019 at 5:25 PM

    Sorry I didn't get back to this sooner. Perhaps I'm not saying it right but what I'm looking to do is use .form-textarea (message) and make it a bit wider than it presently appears. Same with .form-textbox (email).

    For some reason I can't get the CSS to work. It's as if there's a container that is keeping both from becoming wider. Any ideas? Thanks

  • jherwin
    Replied on April 15, 2019 at 7:04 PM

    You can change the textbox and textarea width in your form advanced designer, see screenshot below.
    1555369294advancedesigner Screenshot 10

    Guide:

    1.) Go to your form builder
    2.) Click form designer
    3.) Click the Advanced CSS editor
    1555369395access Screenshot 21

    Please give it a try and let us know how it goes.