On using the is-valid bootstrap4 class or not
See original GitHub issue- Package version: github head
- Django version: 2.1
- Python version: 3.6.7
- Template pack: (Optional) bootstrap4
Description:
Boostrap 4 allows to display even more explicitly which field validate or not after server-side validation as you can see in the documentation
Correct me if I am wrong, but we know that a forms.Form has received data when is_bound is True.
We would thus need to render the field with is-valid
or is-invalid
depending on the presense of field.erros, but only if the form is_bound.
For now I don’t know how to get this information when rendering the field, so my question is twofold:
- Can we access the form object when rendering a field ?
- Is it worth it to use is-valid ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Validation · Bootstrap v5.0
HTML form validation is applied via CSS's two pseudo-classes, :invalid and :valid . It applies to <input> , <select> , and <textarea> elements....
Read more >Bootstrap 4 form validation not working while Using invalid ...
For some reason, when adding class 'is-valid' to my 2nd input in my example, because the 1st input has the 'is-invalid' class, the...
Read more >How to tell if your Bootstrap 4 <form> is valid (works for ALL ...
Lets say you have a simple bootstrap form, that you don't want the validation to fire, until the Submit button is clicked on....
Read more >Bootstrap Validation - examples & tutorial
HTML form validation is applied via CSS's two pseudo-classes, :invalid and :valid . It applies to <input> and <textarea> elements.
Read more >How To Validate HTML 5 Form Elements In Bootstrap 4
HTML form validation is applied via CSS's two pseudo-classes, :invalid and :valid. · Bootstrap scopes the :invalid and :valid styles to parent ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I see. I don’t think that django-filter should suggest any different than what it is doing now as the GET dict is always there. This digs one of my first question which was “Is it worth it to use is-valid ?”. Considering that is-valid will be rendered for every from with GET data, I think we should consider removing the is-valid, and only keep the is-invalid. Would it be ok with you @carltongibson @eriktelepovsky ?
Yes, I think it is the correct approach. Thanks guys.