Add Product Form with Bootstrap: Easy & Responsive

Ruth Jul 09, 2026

Streamlining your e-commerce workflow often involves simplifying the process of adding new products. Bootstrap, a popular CSS framework, can help you create clean, responsive forms for adding products to your inventory. In this guide, we'll explore how to create an effective 'add product' form using Bootstrap.

HTML Form Validation with Bootstrap
HTML Form Validation with Bootstrap

Before we dive into the code, let's consider the key elements of a typical 'add product' form. These usually include fields for product name, description, price, images, categories, and inventory management. We'll create a form that accommodates these elements and is easy to integrate into your existing Bootstrap project.

the homepage for an employee portal with a rocket ship in the background and text that reads, apply as a employee
the homepage for an employee portal with a rocket ship in the background and text that reads, apply as a employee

Setting Up the Form

First, ensure you have included the Bootstrap CSS and JavaScript files in your project. You can either download them or include them via a CDN:

Wizard
Wizard

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

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

Bootstrap Forms
Bootstrap Forms

Creating the Form Structure

Now, let's create the basic structure of our 'add product' form using Bootstrap's grid system and form controls:

<form> <div class="row mb-3"> <label for="productName" class="col-sm-2 col-form-label">Product Name</label> <div class="col-sm-10"> <input type="text" class="form-control" id="productName" placeholder="Enter product name"> </div> </div> </form>

Ultimate Bootstrap Forms
Ultimate Bootstrap Forms

In this example, we're using a row to create a label and input pair. The `col-sm-2` class centers the label, while `col-sm-10` ensures the input field spans the remaining space.

Adding More Fields

Following the same pattern, add fields for product description, price, and categories. For the price field, use the `type="number"` attribute to ensure only numeric input is accepted:

Formidable Forms – Bootstrap Form Styling v.1.03 Download
Formidable Forms – Bootstrap Form Styling v.1.03 Download

<div class="row mb-3"> <label for="productPrice" class="col-sm-2 col-form-label">Price</label> <div class="col-sm-10"> <input type="number" class="form-control" id="productPrice" placeholder="Enter product price" step="0.01"> </div> </div>

Handling Images and Inventory

the product page for an email form
the product page for an email form
Tailwind Form with progress bar
Tailwind Form with progress bar
Bootstrap Responsive Design Registration Form
Bootstrap Responsive Design Registration Form
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
BOOTSTRAP INPUT FORM (2020) | HOW TO MAKE FORM IN BOOTSTRAP
the create new project page on wordpress, with an image of someone's work
the create new project page on wordpress, with an image of someone's work
Responsive Bootstrap Modal And Popup
Responsive Bootstrap Modal And Popup
Product reviews with submit form
Product reviews with submit form
a screenshot of a web page with an image of the user's profile
a screenshot of a web page with an image of the user's profile
the bootstap login and register forms page
the bootstap login and register forms page
Better Forms: Right aligned labels in two column layout
Better Forms: Right aligned labels in two column layout
a screenshot of the external ui kit, which includes several options for each user to use
a screenshot of the external ui kit, which includes several options for each user to use
a screenshot of the facebook form
a screenshot of the facebook form
Design Better Forms - Sergii Vergulenko
Design Better Forms - Sergii Vergulenko
Bootstrap 5 responsive registration form
Bootstrap 5 responsive registration form
Product Gallery Code | Bootstrap 5.3 snippet for building an eCommerce gallery
Product Gallery Code | Bootstrap 5.3 snippet for building an eCommerce gallery
the upload files page is displayed on an iphone
the upload files page is displayed on an iphone
two screens showing the settings and options for each user's website page, with one being
two screens showing the settings and options for each user's website page, with one being
Product reason selection form
Product reason selection form
the settings page for an email form
the settings page for an email form
two iphone screens showing the same user's profile
two iphone screens showing the same user's profile

For product images, use a file input field. To manage inventory, add a numeric input field with a range attribute to limit the input to a specific range:

<div class="row mb-3"> <label for="productImage" class="col-sm-2 col-form-label">Image</label> <div class="col-sm-10"> <input type="file" class="form-control" id="productImage" accept="image/*"> </div> </div>

<div class="row mb-3"> <label for="productInventory" class="col-sm-2 col-form-label">Inventory</label> <div class="col-sm-10"> <input type="number" class="form-control" id="productInventory" placeholder="Enter inventory quantity" min="0" max="1000"> </div> </div>

Submitting the Form

Finally, add a submit button to complete the form:

<div class="row mb-3"> <div class="col-sm-10 offset-sm-2"> <button type="submit" class="btn btn-primary">Add Product</button> </div> </div>

With this setup, you now have a clean, responsive 'add product' form using Bootstrap. You can further customize the form by adding validation, error handling, and integration with your backend services.

Remember, the key to a good user experience is simplicity and intuitiveness. By using Bootstrap's form controls and grid system, you've created a form that's easy to use and integrates seamlessly with your existing Bootstrap project.