torchbox / tbxforms

A Torchbox-flavoured template pack for django-crispy-forms, adapted from crispy-forms-gds.

Home Page:https://pypi.org/project/tbxforms/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: validation errors summary

thibaudcolas opened this issue · comments

Feedback from one of our projects. For us to consider as a feature to add directly in this package?

We built an anchor link navigation block which appears under the h1 of the form if you submit it with errors - with anchor links to the specific fields with errors.
You can see this in action if you submit a form on their site with all fields empty: https://www.rnib.org.uk/living-with-sight-loss/community-connection-and-wellbeing/sight-loss-counselling/online-counselling-form/

Building those kinds of error summaries is commonly considered an accessibility improvement (cognitive, mechanic).

This feature already exists: https://github.com/torchbox/tbxforms/blob/main/tbxforms/templates/tbx/errors.html as described. Or, at least as I've understood it.

The component is a variation of https://design-system.service.gov.uk/components/error-summary/ which includes the field name, as writing field-specific error messages with Django isn't too common.

It sounds to me like this was overridden/modified for RNIB, or not implemented properly within the template.

Is there any more info you can share about this?

That was a quick turnaround :) There isn’t! I assume our implementation is pretty good if it comes from the GDS one, so will close and move on.