![]() |
VOOZH | about |
Bootstrap 5 Validation is supported by various elements present in the form and you can use it to make sure the user knows about which field is mandatory. The different elements in the form group which are supported are:
Bootstrap 5 Validation Supported elements syntax:
<input class="form-control" type="..."
id="..." required>
<div class="invalid-feedback">
...
</div>
Bootstrap 5 Validation Supported elements used classes:
Bootstrap 5 Validation Supported elements used attributes:
Example 1: The code below demonstrates how the validation can be applied on input fields and checks and switches:
Output:
Example 2: The code below demonstrates how the validation doesn't work with disabled inputs:
Output:
Reference:https://getbootstrap.com/docs/5.0/forms/validation/#supported-elements