Adding validation to inputs
Bootstrap 4 comes with some powerful yet easy to use validation styles for input fields. Validation styles are used to show things such as errors, warnings, and success states for form fields when you submit the actual form. Let's take a look at the code to render all three validation states:
<div class="form-group has-success"> <label class="form-control-label">Input with success</label> <input type="text" class="form-control form-control-success"> </div> <div class="form-group has-warning"> <label class="form-control-label">Input with warning</label> <input type="text" class="form-control form-control-warning"> </div> <div class="form-group has-danger"> <label class="form-control-label">Input with danger</label> <input type="text" class="form-control form-control-danger"> </div>
The markup...