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

Form errors not showing when using MultiValueField #987

Open
bodgerbarnett opened this issue Feb 18, 2020 · 2 comments
Open

Form errors not showing when using MultiValueField #987

bodgerbarnett opened this issue Feb 18, 2020 · 2 comments

Comments

@bodgerbarnett
Copy link

  • Package version: 1.8.1
  • Django version: 2.2
  • Python version: 3.8
  • Template pack: bootstrap4

Description:

When I raise a ValidationError on a custom field I've written, which is a MultiValueField, the error doesn't show up. This is because the is-invalid class is not being added to the inputs, as it is with other types of fields. The code in this module (https://github.com/django-crispy-forms/django-crispy-forms/blob/master/crispy_forms/templatetags/crispy_forms_field.py) explicitly says to not add the CSS if the field is a multivaluefield.

I suspect I'm doing something wrong and maybe I should be adding the CSS class in the custom field myself but I'm not sure.

@smithdc1
Copy link
Member

Hi!

Yes currently we don't have multivalue support. This impacts a number of default widgets (e.g. split date time field).

Multivalue fields are a bit more complex, what happens if you have a checkbox and you probably want to have each input inside a div with one of the col classes.

I've done some work to progress this #976. It needs more work but if you have any comments they would be appreciated.

Also see #831

Posted from mobile.

@ghost
Copy link

ghost commented Feb 24, 2020

Same issue, currently, I use javascript as a temporary solution.

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

No branches or pull requests

2 participants