-
-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Hello,
After updating to the latest version of django-bootstrap5, my form field validation errors stopped being visible in the browser.
The HTML contains the error text, but it is not displayed to the user.
In the previous version, the rendered error looked like this (and displayed correctly):
But in the new version, errors are wrapped inside an additional container:
Because of this wrapper (
Questions:
Why was this wrapper added?
How can I make the error visible in the browser without downgrading to the old version?
Is there a recommended Bootstrap-compatible way to style errors with this new HTML structure?
Versions:
Django: 5.2.4
django-bootstrap5: 25.2
Bootstrap: 5.3.7
Example form:
class MyForm(forms.Form):
password = forms.CharField(widget=forms.PasswordInput)
password_confirm = forms.CharField(widget=forms.PasswordInput)
def clean(self):
cleaned_data = super().clean()
if cleaned_data.get("password") != cleaned_data.get("password_confirm"):
self.add_error("password_confirm", "Passwords do not match")
Template:
{% load django_bootstrap5 %}