Explore Templates

Validation

Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript.

Custom styles

For custom React Bootstrap form validation messages, you’ll need to add the novalidate attribute to your <Form> or <form> element

Looks good!
Looks good!
@
Please choose a username.
Please provide a valid city.
Please provide a valid state.
Please provide a valid zip.
You must agree before submitting.
Browser defaults

Not interested in custom validation feedback messages or writing JavaScript to change form behaviors? All good, you can use the browser defaults. Try submitting the form below.

@
You must agree before submitting.
Form libraries and server-rendered styles

It's often beneficial (especially in React) to handle form validation via a library like Formik. In those cases, isValid and isInvalid props can be added to form controls to manually apply validation styles. Below is a quick example integrating with Formik .

Looks good!
Looks good!
@
Looks good!
Looks good!
Looks good!
Looks good!
Supported elements

Form validation styles are also available for bootstrap custom form controls.

Please enter a message in the textarea.
You must check this before submitting.
More example invalid feedback text
Example invalid select feedback
Example invalid form file feedback
Tooltips

If your form layout allows it, you can use the tooltip prop to display validation feedback in a styled tooltip.

Looks good!
Looks good!
@
Please choose a username.
Please provide a valid city.
Please provide a valid state.
Please provide a valid zip.
You must agree before submitting.