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.

Error messages not displayed with crispy forms 1.7.2 (we had a CSS bug)

See original GitHub issue
  • Package version: django-crispy-forms==1.7.2
  • Django version: Django==1.11.23
  • Python version: 3.5 & 3.6
  • Template pack:
CRISPY_TEMPLATE_PACK = 'bootstrap4'
CRISPY_FAIL_SILENTLY = False

Description:

I need help. I don’t know how to display error messages in crispy forms. Currently error messages which are not related to a specific field are not displayed. Error messages related to a specific field are displayed. I need to display all the error messages on the form and I don’t know how? I didn’t find it on the documentation of crispy forms.

You can see my current code on https://github.com/speedy-net/speedy-net/tree/staging The forms not working right now with error messages are with URL /matches/settings/about-my-match/ The template only contains {% crispy form %}.

Preferably also include:

  • Example Django Crispy Forms code
  • Screenshots

When I select a min age higher than max age I do see an error message: 2019-08-07_1300_crispy_1

But when I don’t select any gender there is no error message: 2019-08-07_1300_crispy_2

Also, when the diet (for example) doesn’t contain 5 hearts I can’t see the error message: 2019-08-07_1304_crispy_3

Error messages for fields such as min age and max age are displayed correctly. 2019-08-07_1307_crispy_4

In all the 4 cases above the user is not redirected to the success URL.

  • Actual HTML generated
  • Expected HTML

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20

github_iconTop GitHub Comments

1reaction
carltongibsoncommented, Aug 10, 2019

Super. Thanks for the follow-up. Maybe it helps someone else in the future!

1reaction
carltongibsoncommented, Aug 7, 2019

OK, so I’d have a look what else you have going on in there… (Sorry I don’t think I can help you right now…)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django Crispy Forms - Checkbox not being displayed
Their is an open issue in django-crispy-forms github see ... checkboxes and solve the problem with the error message, I'll appreciate it.
Read more >
django-crispy-forms Documentation
It decides whether to render or not form errors. If set to False, form.errors will not be visible even if they happen. You...
Read more >
django-crispy-forms - PyPI
The best way to have Django DRY forms. Build programmatic reusable layouts out of components, having full control of the rendered HTML without...
Read more >
Advanced Form Rendering with Django Crispy Forms
In this tutorial we are going to explore some of the Django Crispy Forms features to handle advanced/custom forms rendering.
Read more >
Build a Custom UI with Django | CRISPY FORMS - YouTube
In this session, you 'll learn how to create great-looking pages using just a few packages and lines of code. Speaker: Christopher Harrison ......
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