Manage help_text and errors
This commit is contained in:
parent
fdcd2e864c
commit
49c84076de
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,10 @@
|
||||||
<label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
|
<label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
{{ field|add_class:'form-control' }}
|
{{ field|add_class:'form-control' }}
|
||||||
|
{% if field.errors %}
|
||||||
|
<span class="help-block">{{field.errors}}</span>
|
||||||
|
{% else %}
|
||||||
<span class="help-block">{{field.help_text}}</span>
|
<span class="help-block">{{field.help_text}}</span>
|
||||||
<span class="help-block">{{ field.errors }}</span>
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue