Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

romove_page 본문

JSP/GuestBook

romove_page

GAWON 2023. 6. 2. 17:59
<%@page import="org.joonzis.ex.GuestbookDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c"%>  
 
       
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
// 1. 비밀번호 확인 란이 비어있는가?
// 2. session에 저장된 비밀번호(DB에 저장된 pw)와 입력한 비밀번호가 같은가?
// 3. 일치 한다면 정말 삭제하겠는가? (confirm)
	function remove(f){
	if(f.pw.value == '' || f.pw.value != "${sessionScope.vo.pw}"){
		alert("비밀번호를 확인해주세요");
		return;
	}
	
	var a  = confirm("삭제를 정말 하시겠습니까?");
	if(a == true){
	 f.action = 'remove.jsp';
		f.submit();
	}
}


</script>
<style type="text/css">
	div{
		width: 800px;
		margin: auto;
		text-align: center;
	}
	table{
		width: 100%;
		border-collapse: collapse;
		text-align: left;
	}
	td , th{
		border: 1px solid black;
		padding: 10px;
	}
	th{
		width: 100px;
		background-color: lime;
		color: #fff;
		text-align: center;
	}
	tr:nth-of-type(3) {
		text-align: center;
}


</style>
</head>
<body>
	<div>
		<h2>${vo.writer }의 방명록 삭제 확인</h2>
		<form>
			<table>
				<tbody>
					<tr>
						<th>제목</th>
						<td>${vo.title }</td>
					</tr>
					<tr>
						<th>비밀번호 확인</th>
						<td><input type="password" name="pw" size="80"></td>
					</tr>
					<tr>
						<td colspan="2">
							<input type="button" value="방명록 삭제" onclick="remove(this.form)">
							<input type="button" value="목록으로 이동" onclick="location.href='index.jsp'">
						</td>
					</tr>		
				</tbody>
			</table>
		</form>
	</div>
</body>
</html>

'JSP > GuestBook' 카테고리의 다른 글

update_page  (0) 2023.06.02
remove  (0) 2023.06.02
view  (0) 2023.06.02
index  (0) 2023.06.02
download  (0) 2023.06.02