Home > Blockchain >  How to make django form.errors display only error and not input field affected
How to make django form.errors display only error and not input field affected

Time:10-14

enter image description hereBasically, what i am trying to achieve is to remove the name of the input field which in this case is tel and display only the error message using {{ form.errors }}

CodePudding user response:

Errors are also listed by field in the form, so you can loop through with this to avoid mentioning the fieldname:

{% for field in form %}
   {% for error in field.errors %}
        {{ error }}<br>
   {% endfor %}
{% endfor %}
  • Related