gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

How can I create a Bootstrap inline form #348

Closed msaron closed 8 years ago

msaron commented 8 years ago

I am using tcomb-form v0.9.8 and react v15.2.1

How can I create a Bootstrap inline form? Currently I use the following CSS to display the form exactly as I want.

    .form-inline .form-control {
        display: block;
    }

What the above CSS does is create labels on top and the controls on the bottom but the form-control itself flows inline. Form class is form-line.

Thanks.

gcanti commented 8 years ago

Not sure I'm following, exactly what's the issue here?

msaron commented 8 years ago

I want to display the form like the Bootstrap form class 'form-inline'. That displays the labels and controls inline. See http://getbootstrap.com/css/#forms-inline

gcanti commented 8 years ago

I mean, inline forms are not officially supported, but setting the form-inline class on your container <form> doesn't work?

msaron commented 8 years ago

Figured it out after trying various settings. I set the container div style to display: 'inline'. Then I set the following:

    .form-control {
        display: block;
    }

    .form-group {
        display: inline-block;
    }

    .fieldset {
        display: inline;
    }

And now it works fine.

Thanks.