Mastering Bootstrap Forms: A Comprehensive Tutorial

Ruth Jul 09, 2026

Bootstrap, the popular CSS framework, offers a wide range of pre-built components to help you create responsive and mobile-first websites. Among these, forms are a crucial aspect of web development. In this tutorial, we'll guide you through creating and customizing forms using Bootstrap.

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5

Before we dive in, ensure you have included the Bootstrap CSS and JavaScript files in your project. You can include them via a CDN or download and host the files locally. For this tutorial, we'll use the CDN:

Bootstrap Fieldset Legend: How To + Examples + Template | AZMIND
Bootstrap Fieldset Legend: How To + Examples + Template | AZMIND

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>

Basic Bootstrap Form

Let's start by creating a simple form with Bootstrap. We'll use the grid system and form classes to create a responsive form.

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5

Here's a basic example:

<form>
  <div class="mb-3">
    <label for="exampleInputEmail1" class="form-label">Email address</label>
    <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
    <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
  </div>
  <div class="mb-3">
    <label for="exampleInputPassword1" class="form-label">Password</label>
    <input type="password" class="form-control" id="exampleInputPassword1">
  </div>
  <button type="submit" class="btn btn-primary">Submit</button>
</form>

Form Validation

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5

Bootstrap provides built-in validation styles for form inputs. You can use these classes to style and validate your form inputs.

Here's how you can use the validation classes:

<div class="mb-3">
  <label for="exampleInputEmail1" class="form-label">Email address</label>
  <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
  <div id="emailHelp" class="form-text">We'll never share your email with anyone else.</div>
</div>
<div class="mb-3">
  <label for="exampleInputPassword1" class="form-label">Password</label>
  <input type="password" class="form-control" id="exampleInputPassword1">
</div>
<button type="submit" class="btn btn-primary">Submit</button>

Form Layouts

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5

Bootstrap provides several layout options for forms, including horizontal forms and inline forms. These can help you create more complex and visually appealing forms.

Here's an example of a horizontal form:

<form>
  <div class="row mb-3">
    <label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
    <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail3">
    </div>
  </div>
  <div class="row mb-3">
    <label for="inputPassword3" class="col-sm-2 col-form-label">Password</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword3">
    </div>
  </div>
  <div class="row mb-3">
    <div class="col-sm-10 offset-sm-2">
      <div class="form-check">
        <input class="form-check-input" type="checkbox" id="gridCheck1">
        <label class="form-check-label" for="gridCheck1">Remember me</label>
      </div>
    </div>
  </div>
  <div class="row mb-3">
    <div class="col-sm-10 offset-sm-2">
      <button type="submit" class="btn btn-primary">Sign in</button>
    </div>
  </div>
</form>

Advanced Bootstrap Form

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5

Now that we've covered the basics, let's look at some more advanced form elements and components provided by Bootstrap.

Bootstrap includes support for various input types, including checkboxes, radio buttons, and select menus. It also provides support for form grids, which can help you create complex forms with ease.

Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
Bootstrap Tutorial | Bootstrap Notes | Bootstrap 5
HTML Form Validation with Bootstrap
HTML Form Validation with Bootstrap
Best Free Bootstrap Login Forms ยป CSS Author
Best Free Bootstrap Login Forms ยป CSS Author
Wizard
Wizard
Bootstrap Tutorial โ€“ Introduction
Bootstrap Tutorial โ€“ Introduction
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
Bootstrap 5 Classes List Cheat Sheet
Bootstrap 5 Classes List Cheat Sheet
Bootstrap Tutorials: The Best of Azmind | AZMIND
Bootstrap Tutorials: The Best of Azmind | AZMIND
๐Ÿ“ Create Forms in HTML
๐Ÿ“ Create Forms in HTML
How To Center a div Horizontally in Bootstrap 4
How To Center a div Horizontally in Bootstrap 4
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
55 Best Free Bootstrap Registration Form Designs 2026 - Colorlib
Bootstrap Stencils for Visio 2013
Bootstrap Stencils for Visio 2013
Bootstrap Forms
Bootstrap Forms

Form Grid

The form grid system helps you create complex forms with ease. It's based on the Bootstrap grid system and provides a simple way to create forms with multiple columns and rows.

Here's an example of a form grid:

<form>
  <div class="row mb-3">
    <label for="inputEmail" class="col-sm-2 col-form-label">Email</label>
    <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail">
    </div>
  </div>
  <div class="row mb-3">
    <label for="inputPassword" class="col-sm-2 col-form-label">Password</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword">
    </div>
  </div>
  <div class="row mb-3">
    <div class="col-sm-10 offset-sm-2">
      <button type="submit" class="btn btn-primary">Sign in</button>
    </div>
  </div>
</form>

Form with Validation

Bootstrap provides built-in validation styles for form inputs. You can use these classes to style and validate your form inputs.

Here's an example of a form with validation:

<form>
  <div class="row mb-3">
    <label for="inputEmail" class="col-sm-2 col-form-label">Email</label>
    <div class="col-sm-10">
      <input type="email" class="form-control" id="inputEmail">
      <div class="invalid-feedback">Please provide a valid email address</div>
    </div>
  </div>
  <div class="row mb-3">
    <label for="inputPassword" class="col-sm-2 col-form-label">Password</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword">
      <div class="invalid-feedback">Please provide a valid password</div>
    </div>
  </div>
  <div class="row mb-3">
    <div class="col-sm-10 offset-sm-2">
      <button type="submit" class="btn btn-primary">Sign in</button>
    </div>
  </div>
</form>

And that's it! You now have a solid understanding of how to create and customize forms using Bootstrap. Whether you're building a simple contact form or a complex multi-step form, Bootstrap has you covered. Happy coding!