Browser Default Validation

HTML form validation is applied via CSS's two pseudo-classes, :invalid and :valid.

Minimum 8 characters
Custom Bootstrap Validation

For custom Bootstrap form validation messages, you'll need to add the novalidate boolean attribute to your form.

Looks good!
Please provide a valid first name.
Looks good!
Please provide a valid last name.
Valid email address!
Please provide a valid email address.
Strong password!
Password must be at least 8 characters long.
You must agree before submitting.
Server Side Validation Example

We recommend using client-side validation, but in case you require server-side validation, you can indicate invalid and valid form fields with .is-invalid and .is-valid.

Looks good!
Looks good!
@
Username is already taken.
Please provide a valid city.
Please select a valid state.
Please provide a valid zip.
Supported Elements

Validation styles are available for the following form controls and components:

Input Fields
Please enter a message in the textarea.
Please select a valid option.
Please select a file.
Checkboxes and Radios
You must check this box.
Please select a radio button.
You must toggle this switch.
Real-time Validation Example

This form demonstrates real-time validation with custom rules as you type.

Must be 4-20 characters, alphanumeric only
Password strength: None
Advanced Registration Form
Personal Information
Please enter a valid name (letters only).
You must be at least 18 years old.
Please select your gender.
Contact Information
Please provide a valid email address.
Please provide a valid phone number (123-456-7890).
Please provide a valid URL.
Address Information
Please provide your address.
Please provide a valid city.
Please select a state.
Please provide a valid 5-digit zip code.
You must agree to the terms and conditions.