瀏覽代碼

CensusEntry BirthDay and BirthYear added to form

Andrew Grant 7 月之前
父節點
當前提交
7b293ab3b5
共有 1 個文件被更改,包括 25 次插入0 次删除
  1. 25 0
      src/main/resources/templates/censusentry/form.html

+ 25 - 0
src/main/resources/templates/censusentry/form.html

@@ -135,12 +135,37 @@ rounded-3 text-center p-4">
                 <label for="age">Age</label>
                 <input class="form-control" id="age"
                        th:field="*{age}" type="text">
+                <div th:if="${#fields.hasErrors('age')}">
+                    <ul class="text-danger">
+                        <li th:each="err : ${#fields.errors('age')}" th:text="${err}" style="width: 300px;"/>
+                    </ul>
+                </div>
             </div>
             <div class="col-md-2">
                 <label for="whereBorn">Where Born</label>
                 <input class="form-control" id="whereBorn"
                        th:field="*{whereBorn}" type="text">
             </div>
+            <div class="col-md-2">
+                <label for="birthDay">Birthday (dd/mm)</label>
+                <input class="form-control" id="birthDay"
+                       th:field="*{whereBorn}" type="text">
+                <div th:if="${#fields.hasErrors('birthDay')}">
+                    <ul class="text-danger">
+                        <li th:each="err : ${#fields.errors('birthDay')}" th:text="${err}" style="width: 300px;"/>
+                    </ul>
+                </div>
+            </div>
+            <div class="col-md-2">
+                <label for="birthYear">Birth Year</label>
+                <input class="form-control" id="birthYear"
+                       th:field="*{birthYear}" type="text">
+                <div th:if="${#fields.hasErrors('birthYear')}">
+                    <ul class="text-danger">
+                        <li th:each="err : ${#fields.errors('name')}" th:text="${err}" style="width: 300px;"/>
+                    </ul>
+                </div>
+            </div>
         </div>
 
         <button type="submit" class="btn btn-primary">Commit</button>