Form

HTML Form Boilerplate

Complete reference for form inputs and validation

Text Inputs

Basic text input with placeholder
Validates email format
Minimum 8 characters
Telephone number input
Validates URL format
Search input with clear button
Multi-line text input

Number & Date Inputs

Min: 0, Max: 100, Step: 1
Value: 50
Color selection input
Date picker
Time picker
Date and time picker
Month and year picker
Week picker

Selection Inputs

Single selection dropdown
Hold Ctrl/Cmd to select multiple
Autocomplete with suggestions

Checkboxes & Radio Buttons

Select multiple options
Select one option
On/off toggle switch

File & Advanced Inputs

Single file upload
Multiple file upload
Images only (jpg, png, gif, etc.)
This is a hidden input field with value “hidden-value”

Input Groups & Floating Labels

$ .00
Input with prefix and suffix
@
Input with prefix
Floating label input
Floating label select

Form Validation

Looks good!
Please provide a valid input.
You must agree before submitting.

Form Actions

Basic Form Structure

<form id=”myForm” method=”POST” action=”/submit” enctype=”multipart/form-data”> <div class=”mb-3″> <label for=”inputId” class=”form-label”>Label Text</label> <input type=”text” class=”form-control” id=”inputId” name=”inputName” required> <div class=”form-text”>Helper text</div> </div> <button type=”submit” class=”btn btn-primary”>Submit</button> </form>