Showing validation errors field by field

This commit is contained in:
Francesco
2023-10-10 21:30:49 +02:00
parent 8b88475d8a
commit 13b45e62b8
4 changed files with 46 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
.text-red {
color: red;
}
.separator-light {
opacity: 25%;
}

View File

@@ -57,6 +57,10 @@
"></th:block>
</th:block>
<ul class="text-red mt-2" th:if="${validationErrors != null && !validationErrors.isEmpty()}">
<li th:each="error : ${validationErrors.forField(field.getName())}"
th:text="${error.getMessage()}"></li>
</ul>
<div class="separator mt-3 mb-2 separator-light"></div>
</div>