[Answered ]-Some of the error list members in django form doesn't show up in the template

0👍

the problem would be solved with this code lines:

{% for field in form %} 
    <div class="row"> 
        <div class="error">{{ field.errors }}</div> 
        <br/> 
        <div class="lable">{{ field.label }}</div> 
        <div class="field">{{ field }}</div> 
    </div> 
{% endfor %}

😉

2👍

You get errors in field_name.errors for each field.
form.errors gives any error for entire form and not specific to a field.

Refer below sample from django docs here

<form action="/contact/" method="post">
{% for field in form %}
    <div class="fieldWrapper">
        {{ field.errors }}
        {{ field.label_tag }}: {{ field }}
    </div>
{% endfor %}
<p><input type="submit" value="Send message" /></p>

👤Rohan

Leave a comment