summaryrefslogtreecommitdiff
path: root/spring-boot/10-role-based-security/src/main/resources/templates/security/user-form.html
blob: a27ae7d66caca7773fe2d1359972a8af34e7c576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"
    th:replace="~{layout/main :: layout(title='User', content=~{::main})}">

<body>
    <main>
        <form th:action="@{/security/user/update}" th:object="${userForm}" method="post">
            <!-- Hidden field binds the "id" property seamlessly -->
            <input type="hidden" th:field="*{id}" />

            <div class="form-field-container">
                <label>Description</label>
                <textarea th:field="*{description}" placeholder="Description"></textarea>
                <div class="validation-error" th:if="${#fields.hasErrors('description')}" th:errors="*{description}"></div>
            </div>

            <button type="submit">Save</button>
        </form>
    </main>
</body>

</html>