Ver código fonte

Marriage Certificate Form bride and groom errors not displaying

Andrew Grant 4 meses atrás
pai
commit
b671ec9b34

+ 14 - 2
src/main/resources/templates/certificates/marriageCertificate/form.html

@@ -278,11 +278,17 @@
                     <label for="brideCondition">Bride Condition :&nbsp;</label>
                 </td>
                 <td style="text-align: left;">
-                    <select id="brideCondition" style="width: 200px;" name="brideCondition" th:field="*{brideCondition}">
+                    <select id="brideCondition" style="width: 200px;" name="brideCondition"
+                            th:field="*{brideCondition}">
                         <option th:value="${''}" th:text="${''}"></option>
                         <option th:each="value : ${T(scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition).values()}"
                                 th:value="${value}" th:text="${value.label}"></option>
                     </select>
+                    <div th:if="${#fields.hasErrors('brideCondition')}">
+                        <ul class="text-danger">
+                            <li th:each="err : ${#fields.errors('brideCondition')}" th:text="${err}"/>
+                        </ul>
+                    </div>
                 </td>
             </tr>
             <tr>
@@ -422,11 +428,17 @@
                     <label for="groomCondition">Groom Condition :&nbsp;</label>
                 </td>
                 <td style="text-align: left;">
-                    <select id="groomCondition" style="width: 200px;" name="groomCondition" th:field="*{groomCondition}">
+                    <select id="groomCondition" style="width: 200px;" name="groomCondition"
+                            th:field="*{groomCondition}">
                         <option th:value="${''}" th:text="${''}"></option>
                         <option th:each="value : ${T(scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition).values()}"
                                 th:value="${value}" th:text="${value.label}"></option>
                     </select>
+                    <div th:if="${#fields.hasErrors('groomCondition')}">
+                        <ul class="text-danger">
+                            <li th:each="err : ${#fields.errors('groomCondition')}" th:text="${err}"/>
+                        </ul>
+                    </div>
                 </td>
             </tr>
             <tr>