diff --git a/flask_bootstrap/templates/bootstrap/wtf.html b/flask_bootstrap/templates/bootstrap/wtf.html
index 18192006..0b894240 100644
--- a/flask_bootstrap/templates/bootstrap/wtf.html
+++ b/flask_bootstrap/templates/bootstrap/wtf.html
@@ -4,7 +4,7 @@
{%- if bootstrap_is_hidden_field(form[fieldname]) and hiddens or
not bootstrap_is_hidden_field(form[fieldname]) and hiddens != 'only' %}
{%- for error in errors %}
-
{{error}}
+ {{error}}
{%- endfor %}
{%- endif %}
{%- endfor %}
@@ -108,7 +108,7 @@
{%- if field.errors %}
{%- for error in field.errors %}
{% call _hz_form_wrap(horizontal_columns, form_type, required=required) %}
- {{error}}
+ {{error}}
{% endcall %}
{%- endfor %}
{%- elif field.description -%}
@@ -118,15 +118,23 @@
{%- endif %}
{%- else -%}
{{field.label(class="form-control-label")|safe}}
- {% if field.type == 'FileField' %}
- {{field(class="form-control-file", **kwargs)|safe}}
+ {%- if field.errors %}
+ {% if field.type == 'FileField' %}
+ {{field(class="form-control-file is-invalid", **kwargs)|safe}}
+ {% else %}
+ {{field(class="form-control is-invalid", **kwargs)|safe}}
+ {% endif %}
{% else %}
- {{field(class="form-control", **kwargs)|safe}}
+ {% if field.type == 'FileField' %}
+ {{field(class="form-control-file", **kwargs)|safe}}
+ {% else %}
+ {{field(class="form-control", **kwargs)|safe}}
+ {% endif %}
{% endif %}
{%- if field.errors %}
{%- for error in field.errors %}
- {{error}}
+ {{error}}
{%- endfor %}
{%- elif field.description -%}
{{field.description|safe}}