diff --git a/templates/look-and-feel/components/fields.njk b/templates/look-and-feel/components/fields.njk index 5d6e83e..876508f 100644 --- a/templates/look-and-feel/components/fields.njk +++ b/templates/look-and-feel/components/fields.njk @@ -7,9 +7,8 @@ Renders a simple text box input field. #} {% macro textbox(field, label, hint=false) %} -
+
- {{ errorsFor(field) }} + {{ errorsFor(field) }} - - {{ errorsFor(field) }} +
@@ -72,10 +70,11 @@

{{ question }}

{% endif %} {% if hint -%} - + {{ hint }} {%- endif %} + {{ errorsFor(field) }} {% for option in options -%} @@ -103,10 +102,17 @@ {% endmacro %} {% macro errorsFor(field) -%} - {% if field.error %} - - {{ field.error | safe}} + {% if field.errors %} + {% for error in field.errors -%} + + {{ error | safe}} - {% endif %} + {%- endfor %} + {% endif %} {%- endmacro %} +{% macro errorClass(field) -%} + {% if field.errors and field.errors|length > 0 %} + form-group-error + {% endif %} +{%- endmacro %} diff --git a/templates/look-and-feel/layouts/question.html b/templates/look-and-feel/layouts/question.html index d78f25f..c09e881 100644 --- a/templates/look-and-feel/layouts/question.html +++ b/templates/look-and-feel/layouts/question.html @@ -15,14 +15,14 @@
- {%- if invalidFields and invalidFields.length !== 0 -%} + {%- if form.validated and not form.valid -%}

There was a problem