{% extends "admin/base_site.html" %} {% load i18n %}{% load url from future %} {% block bodyclass %}grp-doc{% endblock %} {% block content-class %}{% endblock %} {% block title %}Grappelli Documentation » Errors in Forms{% endblock %} {% block extrahead %} {% endblock %} {% block breadcrumbs %} {% endblock %} {% block content %}

Errors in Forms

Basics

Within Django there are basically two elements delivering error-messages: A p.errornote and a ul.errorlist.
Errornotes and -lists are outside Grappellis namespace because they come from the depth of Django.

Errornote

  • Errorlist
{% filter force_escape %}

Errornote

  • Errorlist
{% endfilter %}

Field Errors

A field-error requires to add .grp-errors to the element wrapping the concerned label and form field.

Below the errorous form field there's a ul.errorlist with li displaying the error-messages.

Module

  • Error with that form field

Helptext

{% filter force_escape %}

Module

  • Error with that form field

Helptext

{% endfilter %}

Non-Form & Non-Field Errors in Stacked Groups

They have to be placed directly after the groups/modules heading or directly after the tools if there are any.

Stacked Group

  • Non-Form Errorlist

Module

  • Non-Field Errorlist
  • Error with that form field

Non-Form & Non-Field Errors in Tabular Groups

The non-form errorlist has to be placed directly after the groups heading or directly after the tools if there are any.

The non-field errorlist has to be the first child of the .grp-module.grp-tbody.

Tabular Group

  • Non-Form Errorlist
Table-Head 1
Table-Head 2
  • Non-Field Errorlist
  • Error with that form field
{% filter force_escape %}

Tabular Group

  • Non-Form Errorlist
Table-Head 1
Table-Head 2
  • Non-Field Errorlist
  • Error with that form field
{% endfilter %}

Errornote

The p.errornote is currently used before the very first group or module, e.g. with the change form.

Errornote

Module

  • Error with that form field

Helptext

{% filter force_escape %}

Errornote

Module

  • Error with that form field

Helptext

{% endfilter %}
{% endblock %}