A Javascript handler for form|fields messages.
As a developer, I have been several times, in the awkward position, needing to implement custom code, that will co-operate with bs-form fields. So, many times I had the same thought. "What if bootstrap provided the base 'JS adapter' for its fields"
This PR tries to provide a Bootstrap component, that automatically handle browser validation messages, and in addition will give the opportunity to use custom, given feedback messages.
In advance, it contains JavaScript code, providing
- on form component:
- method to
clear
these messages, - get FormData` (for ajax usage)
- execute
validation
- access each formField instance
- JS hook, through component configuration, where developers can use for Ajax submission (not provided by default) and/or attach any custom validation messages
- method to
- per field methods:
-
clear
appended feedbacks - append
success | error | info
feedback messages
-
Needs:
-
Documentation -
Tests - Feedback
Cons:
Adds a significant size as it introduces two new classes
Related #28414 close #28995
Preview : https://deploy-preview-34043--twbs-bootstrap.netlify.app/docs/5.2/forms/validation/#custom-styles