Two fields on the same line in a vertical form with bootstrap

Leandro Faria

I would like the fields "Name" and "Last Name" to be on the same row.

I've found some solutions such as this one here in stackoverflow, but the problem is that I want the labels positioned above the fields to be side by side too.

How is that possible?

enter image description here

Here's the form code:

<form>
  <div class="form-group">
    <label for="inputName">Name:</label>
    <input type="text" class="form-control" id="inputName" placeholder="Enter your name here" value="Leandro">
  </div>
  <div class="form-group">
    <label for="inputLastName">Last Name:</label>
    <input type="text" class="form-control" id="inputLastName" placeholder="Enter your last name here" value="Faria">
  </div>
  <div class="form-group">
    <label for="inputTitle">Title:</label>
    <input type="text" class="form-control" id="inputTitle" placeholder="Enter your title here" value="CEO">
  </div>
  <div class="form-group">
    <label for="inputEmail">Email:</label>
    <input type="email" class="form-control" id="inputEmail" placeholder="Enter your email here" value="[email protected]">
  </div>
  <div class="form-group bottom-buffer">
    <label for="selectEmail">Notifications:</label>
    <select class="form-control" id="selectEmailNotifications">
      <option>None</option>
      <option>Daily</option>
      <option>Weekly</option>
      <option selected>Monthly</option>
    </select>
  </div>
  <div class="form-group bottom-buffer">
    <label for="selectEmail">Status:</label>
    <select class="form-control" id="selectEmailNotifications">
      <option selected>Active</option>
      <option>Inactive</option>
    </select>
  </div>
  <div class="form-group bottom-buffer">
    <label for="selectEmail">Profile:</label>
    <select class="form-control" id="selectEmailNotifications">
      <option selected>Administrator</option>
      <option>User</option>
    </select>
  </div>
</form>

brian

Something like this should get you started.

<div class="row">
  <div class="col-sm-6">
    <div class="form-group">
      <label for="inputName">Name:</label>
      <input type="text" class="form-control" id="inputName" placeholder="Enter your name here" value="Leandro">
    </div>
  </div>
  <div class="col-sm-6">
    <div class="form-group">
      <label for="inputLastName">Last Name:</label>
      <input type="text" class="form-control" id="inputLastName" placeholder="Enter your last name here" value="Faria">
    </div>
  </div>
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to display 2 form fields on same line with bootstrap

From Dev

ExtJS form with labels and fields on the same line

From Dev

Bootstrap complex form layout for combined vertical/inline fields

From Java

Display two fields side by side in a Bootstrap Form

From Dev

How to create a vertical line with the same length as the row in Bootstrap 3

From Dev

Bootstrap form validation validates all the fields inside same form group

From Dev

Bootstrap 3: Two forms on the same line

From Dev

Bootstrap3 two dropdowns on the same line

From Dev

Two divs same line: why overflow: hidden; causes vertical offset?

From Dev

Bootstrap Horizontal Form not vertical

From Dev

Vertical Form Fields Acting Weird

From Dev

How can I render form fields in the same line in Django Template

From Dev

Putting button (outside <form>) on the same line as input fields?

From Dev

How to create form with two input line on the same line?

From Dev

How do i show date of birth input fields in a vertical form in bootstrap 3?

From Dev

Bootstrap 3.2: Button group and input group on same line in form

From Dev

Bootstrap inline form's submit button not in the same line

From Dev

Select form and its label in same line in bootstrap3

From Dev

Bootstrap inline form's submit button not in the same line

From Dev

How to force two element alignment in the same line bootstrap model

From Dev

Getting two date time pickers on the same line with bootstrap 3?

From Dev

HTML/CSS: style form labels to display on the same line and inline with form fields

From Dev

Bootstrap way to add vertical space between the fields

From Dev

Clearing form input fields in Bootstrap?

From Dev

bootstrap form - cant add fields

From Dev

Bootstrap form fields not aligning in layout

From Dev

HTML bootstrap form fields alignment

From Dev

Form POST HTML with same fields

From Dev

Bootstrap 5 horizontal and vertical center on form

Related Related

  1. 1

    how to display 2 form fields on same line with bootstrap

  2. 2

    ExtJS form with labels and fields on the same line

  3. 3

    Bootstrap complex form layout for combined vertical/inline fields

  4. 4

    Display two fields side by side in a Bootstrap Form

  5. 5

    How to create a vertical line with the same length as the row in Bootstrap 3

  6. 6

    Bootstrap form validation validates all the fields inside same form group

  7. 7

    Bootstrap 3: Two forms on the same line

  8. 8

    Bootstrap3 two dropdowns on the same line

  9. 9

    Two divs same line: why overflow: hidden; causes vertical offset?

  10. 10

    Bootstrap Horizontal Form not vertical

  11. 11

    Vertical Form Fields Acting Weird

  12. 12

    How can I render form fields in the same line in Django Template

  13. 13

    Putting button (outside <form>) on the same line as input fields?

  14. 14

    How to create form with two input line on the same line?

  15. 15

    How do i show date of birth input fields in a vertical form in bootstrap 3?

  16. 16

    Bootstrap 3.2: Button group and input group on same line in form

  17. 17

    Bootstrap inline form's submit button not in the same line

  18. 18

    Select form and its label in same line in bootstrap3

  19. 19

    Bootstrap inline form's submit button not in the same line

  20. 20

    How to force two element alignment in the same line bootstrap model

  21. 21

    Getting two date time pickers on the same line with bootstrap 3?

  22. 22

    HTML/CSS: style form labels to display on the same line and inline with form fields

  23. 23

    Bootstrap way to add vertical space between the fields

  24. 24

    Clearing form input fields in Bootstrap?

  25. 25

    bootstrap form - cant add fields

  26. 26

    Bootstrap form fields not aligning in layout

  27. 27

    HTML bootstrap form fields alignment

  28. 28

    Form POST HTML with same fields

  29. 29

    Bootstrap 5 horizontal and vertical center on form

HotTag

Archive