0

I'm new to bootstrap and have a problem placing two input fields next to each other. I've searched on the internet (and bootstrap.com), but couldn't find the anser.

Code: The code

Result. But I need the input fields and button next to each other in one row:

Result. But I need the input fields and button next to each other in one row

I tried using columns... didn't work

MatejMecka
  • 1,448
  • 2
  • 24
  • 37

2 Answers2

0

You can follow : Display two fields side by side in a Bootstrap Form

<div class="input-group">
<input type="text" class="form-control" placeholder="Start"/>
<span class="input-group-addon">-</span>
<input type="text" class="form-control" placeholder="End"/>

Community
  • 1
  • 1
  • Thank you for your quick comment. I have used your example and found that the "input-group was wrong". I Have corrected it with: "form-incline". I found it on http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/bootstrap-forms.php – Luc Schnabel Feb 10 '16 at 13:47
0

You can try below code

<div class="container content">
    <div class='row'>
        <form role="form" class="form-horizontal" method="post">
            <div class='col-xs-12 col-sm-4'>
                <div class="form-group">
                    <input class="form-control" name="" placeholder="Search from this date">
                </div>
            </div>
            <div class='col-xs-12 col-sm-4'>
                <div class="form-group">
                    <input class="form-control" name="" placeholder="Search till this date">
                </div>
            </div>
            <div class='col-xs-12'>
                <div class="form-group">
                    <button class="btn btn-primary">Search</button>
                </div>
            </div>
            <div class='col-xs-12'>
                <div class="form-group">
                    <a href="link">Back</a>
                </div>
            </div>
        </form>
    </div>
</div>
freedomn-m
  • 27,664
  • 8
  • 35
  • 57
dhamo dharan
  • 138
  • 2
  • 11