Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing validation on specific fields or form #738

Open
TohidN opened this issue Dec 19, 2024 · 1 comment · May be fixed by #739
Open

Customizing validation on specific fields or form #738

TohidN opened this issue Dec 19, 2024 · 1 comment · May be fixed by #739

Comments

@TohidN
Copy link

TohidN commented Dec 19, 2024

I tried to disable validation of a form or it's specific fields. but it seems that django-bootstrap5 forces validation for all bound forms:

def get_server_side_validation_classes(self):

  • I tried to remove 'is-valid' from my form object, but the validation css class is added before rendering.
  • I can use server_side_validation in django-bootstrap5 settings but it's global and I don't want to stop validating other forms.

I suggest adding a new parameter to template tags responsible for rendering forms and fields. E.g. {% bootstrap_form form server_side_validation=False %}.

@TohidN TohidN changed the title Customizing validation on specific fields or all form Customizing validation on specific fields or form Dec 19, 2024
@suspiciousRaccoon suspiciousRaccoon linked a pull request Dec 19, 2024 that will close this issue
@suspiciousRaccoon
Copy link

I found myself with the same problem. However it seemed easy to implement, I opened a PR with this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants