0

I am trying to make an inline text field within a horizontal form, basically I want to split the form in to two sections ( left and right) , in the left hand I will have like horizontal text fields and some inline as well and on the right hand side I want to have some inline and some are not.

How could I establish something like that , maybe this drawing could help: JSFiddle Here : http://jsfiddle.net/XQx6v/

Here is my code which is not working ( I want to make it 900 px centered and also responsive to drop to the other line if its small):

  <form class="form-horizontal" action="" method="POST">
   <!-- first Row -->
          <div style="margin:auto; width:900px;" class="row">
             <div class="col-xs-6">
                  <div class="row">
                      <div class="form-group">
                        <label class="control-label">First Name</label>
                        <input type="text" value="test" name="first_name" class="form-control beta">
                        <label class="control-label">Last Name</label>
                        <input type="text" value="test" name="last_name" class="form-control beta">            </div>
                 </div>
             </div>
            <!-- Next Column -->
            <div class="col-xs-6">
               <div class="row">
               <p> testhghghjg </p>
            </div>  
       </div>
     </div>
  </form>

Thanks

6
  • Post a jsfiddle with what you have so people may edit it. - I believe that you used <div class="col-xs-6"> incorrectly Commented May 20, 2014 at 21:05
  • I am not familiar with JSfiddle how to do that? Commented May 20, 2014 at 21:08
  • Go to jsfiddle.net > set up your project there > save it > and post the link here in your question Commented May 20, 2014 at 21:09
  • check it here : jsfiddle.net/XQx6v Commented May 20, 2014 at 21:12
  • I think getbootstrap.com/css/#forms-inline is exactly what you want. Commented May 20, 2014 at 21:46

1 Answer 1

0

I think you don't actually want what Bootstrap refers to as an inline form, but a form with inline elements... Try this Bootply

<div class="container" style="max-width:900px">

  <div class="row">
    <div class="col-md-3">
      <form role="form">
       <div class="form-group">
         <label>Name 1</label>
         <input type="email" class="form-control" placeholder="Enater Name">
       </div>
      </form>
    </div>

    <div class="col-md-3">
      <form role="form">
       <div class="form-group">
         <label>Name 2</label>
         <input type="email" class="form-control" placeholder="Enater Name">
       </div>
      </form>
    </div>

    <div class="col-md-3">
      <form role="form">
       <div class="form-group">
         <label>Name 3</label>
         <input type="email" class="form-control" placeholder="Enater Name">
       </div>
      </form>
    </div>

    <div class="col-md-3">
      <form role="form">
       <div class="form-group">
         <label>Name 4</label>
         <input type="email" class="form-control" placeholder="Enater Name">
       </div>
      </form>
    </div>
  </div></div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.