question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bryan-brancottecommented, Aug 27, 2019

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 ?

0reactions
eriktelepovskycommented, Aug 27, 2019

Yes, I think it is the correct approach. Thanks guys.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found