form-validation.mdx 1.2 KB

12345678910111213141516171819202122232425
  1. ---
  2. title: Validation states
  3. description: To inform users whether the entered value is correct or not, use either of the validation states. Thanks to that, users will immediately know which form elements they need to correct and, if the state displays as invalid, why the value is incorrect.
  4. ---
  5. ```html example code centered columns="1" height="20rem"
  6. <div class="mb-3">
  7. <label class="form-label">Validation States </label>
  8. <input type="text" class="form-control is-valid mb-2" placeholder="Valid State..." />
  9. <input type="text" class="form-control is-invalid" placeholder="Invalid State..." />
  10. <div class="invalid-feedback">Invalid feedback</div>
  11. </div>
  12. ```
  13. ## Subtle validation states
  14. If you prefer a more subtle manner of informing users of the input control validation state, you can use tick and cross symbols and resign from colored control frames and the validation feedback.
  15. ```html example code centered columns="1" height="20rem"
  16. <div class="mb-3">
  17. <label class="form-label">Validation States (lite)</label>
  18. <input type="text" class="form-control is-valid is-valid-lite mb-2" placeholder="Valid State..." />
  19. <input type="text" class="form-control is-invalid is-invalid-lite" placeholder="Invalid State..." />
  20. </div>
  21. ```