[Thymeleaf][HTML] 간단한 메모장 구현하기 5 (메모 편집 페이지 만들기)

PersesTitan·2022년 6월 26일
0

Spring

목록 보기
29/48
post-thumbnail

마지막으로 메모 값을 변경하는 페이지를 만들어주었습니다.

  1. 메인 페이지 (index.html)
  2. 메모 리스트 페이지 (memo_list.html)
  3. 메모 생성 페이지 (new_memo.html)
  4. 메모 상세정보 페이지 (memo.html)

5. 메모 편집 페이지 (edit_memo.html)

<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>편집</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
    <h1>메모 편집</h1>
    <form action="item/memo.html" th:action method="post">
        <h3 for="title">제목</h3>
        <input type="text" id="title" name="title" th:value="${memo.title}" placeholder="제목">
        <br>

        <h3 for="content">내용</h3>
        <textarea name="content" id="content" cols="30" rows="10" th:text="${memo.content}" placeholder="내용"></textarea>
        <br>
        <button type="submit">완료</button>

        <button onclick="location.href='memo_list.html'"
                th:onclick="|location.href='@{/memos}'|"
                type="button">목록으로</button>

        <button onclick="location.href='item/memo.html'"
                th:onclick="|location.href='@{/memo/{id}(id=${id})}'|"
                type="button">취소</button>
    </form>
</body>
</html>

동작


Groovy 버전 코드
Java 버전 코드
Kotlin 버전 코드

profile
안녕하세요 페르세스 티탄입니다! 부족한 부분이 많이 있겠지만 잘부탁드립니다.

0개의 댓글