내정보 수정페이지
<c:forTokens> 구분자
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>prac</title>
<link rel="stylesheet" type="text/css"
href="${ pageContext.servletContext.contextPath }/resources/css/member-style.css">
</head>
<body>
<c:import url="../common/menubar.jsp"/>
<h1 align="center">${ loginUser.name }님의 정보 수정</h1>
<div class="centerText">
<form action="mupdate.me" method="post">
<table>
<tr>
<th>아이디</th>
<td>${loginUser.id }
<input type="hidden" name="id" value="${loginUser.id }">
</td>
</tr>
<tr>
<th>이름</th>
<td>
<input type="text" name="name" value="${ loginUser.name }"></td> <!-- input text박스 안에 value값이 들어가있는 상태가 됨 -->
</td>
</tr>
<tr>
<th>닉네임</th>
<td><input type="text" name="nickName" value="${loginUser.nickName }"></td>
</tr>
<tr>
<th>성별</th>
<c:if test="${loginUser.gender == 'M' }">
<td>
<input type="radio" name="gender" value="M" checked readonly>남
<input type="radio" name="gender" value="F" readonly>여
</td>
</c:if>
<c:if test="${loginUser.gender == 'F' }">
<td>
<input type="radio" name="gender" value="M" readonly>남
<input type="radio" name="gender" value="F" checked readonly>여
</td>
</c:if>
</tr>
<tr>
<th>나이</th>
<td><input type="number" min="20" max="100" name="age" value="${ loginUser.age }"></td>
<!-- input 타입넘버도 value로 안에 값을 넣어서 보여줄 수 있음 -->
</tr>
<tr>
<th>이메일</th>
<td><input type="email" name="email" value="${loginUser.email }"></td>
</tr>
<tr>
<th>전화번호</th>
<td><input type="tel" name="phone" value="${loginUser.phone }"></td>
</tr>
<c:forTokens var="addr" items="${loginUser.address }" delims="/" varStatus="vs">
<c:if test="${ status.index eq 0 && addr >= '0' && addr <= '99999' }">
<c:set var="post" value="${ addr }"/>
</c:if>
<c:if test="${ status.index eq 0 && !(addr >= '0' && addr <= '99999') }">
<c:set var="address1" value="${ addr }"/>
</c:if>
<c:if test="${ status.index eq 1 }">
<c:set var="address1" value="${ addr }"/>
</c:if>
<c:if test="${ status.index eq 2 }">
<c:set var="address2" value="${ addr }"/>
</c:if>
</c:forTokens>
<tr>
<th>우편번호</th>
<td>
<input type="text" name="post" class="postcodify_postcode5" value="${ post }" size="6">
<button type="button" id="postcodify_search_button">검색</button>
</td>
</tr>
<tr>
<th>도로명 주소</th>
<td><input type="text" name="address1" class="postcodify_address" value="${ address1 }" size="30"></td>
</tr>
<tr>
<th>상세주소</th>
<td><input type="text" name="address2" class="postcodify_extra_info" value="${ address2 }" size="30"></td>
</tr>
<!-- jQuery와 Postcodify를 로딩한다. -->
<script src="//d1p7wdleee1q2z.cloudfront.net/post/search.min.js"></script>
<script>
// 검색 단추를 누르면 팝업 레이어가 열리도록 설정한다.
$(function(){
$("#postcodify_search_button").postcodifyPopUp();
});
</script>
<tr>
<td colspan="2" align="center">
<input type="submit" value="수정하기"> <!-- value값이 버튼이 되서 나옴 -->
<c:url var="mdelete" value="mdelete.me">
<c:param name="id" value="${ loginUser.id }"/>
</c:url>
<button type="button" onclick="location.href='${mdelete}'">탈퇴하기</button>
<button type="button" onclick="location.href='home.do'">시작 페이지로</button>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
'small steps > 1일 1코딩 - 코딩을 내 몸처럼' 카테고리의 다른 글
[1일 1코딩][Web] myPage.jsp (feat. EL+JSTL) 3 (0) | 2022.07.22 |
---|---|
[1일 1코딩][Web] memberUpdateForm.jsp (feat. EL+JSTL) 2 (0) | 2022.07.21 |
[1일1코딩][Web] memberJoin.jsp (feat.ajax + 유효성검사) (0) | 2022.07.19 |
[1일 1코딩][Web] menubar.jsp (feat. EL+JSTL) 2 (0) | 2022.07.18 |
[1일 1코딩][Web] myPage.jsp (feat. EL+JSTL) (0) | 2022.07.17 |