Browse Source

Death Certificate Form - spouse changed to dropdown

Andrew Grant 4 tháng trước cách đây
mục cha
commit
61fcd342e3

+ 9 - 8
src/main/resources/templates/certificates/deathCertificate/form.html

@@ -360,14 +360,15 @@
                     <label for="spouse">Spouse :&nbsp;</label>
                 </td>
                 <td style="text-align: left;">
-                    <div>
-                        <input class="spouse" id="spouse"
-                               th:field="*{spouse}" type="text">
-                        <div th:if="${#fields.hasErrors('spouse')}">
-                            <ul class="text-danger">
-                                <li th:each="err : ${#fields.errors('spouse')}" th:text="${err}"/>
-                            </ul>
-                        </div>
+                    <select id="spouse" name="spouse" th:field="*{spouse}">
+                        <option th:value="${''}" th:text="${''}"></option>
+                        <option th:each="person : ${people}"
+                                th:value="${person.id}" th:text="${person.toString()}"></option>
+                    </select>
+                    <div th:if="${#fields.hasErrors('spouse')}">
+                        <ul class="text-danger">
+                            <li th:each="err : ${#fields.errors('spouse')}" th:text="${err}"/>
+                        </ul>
                     </div>
                 </td>
             </tr>