JSP/JSP.sideproject
remove_page.jsp
GAWON
2023. 6. 23. 12:48
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!-- 게시글 삭제 화면 -->
<style type="text/css">
div {
width: 800px;
margin: auto;
text-align: center;
}
table {
width: 800px;
text-align: left;
border-collapse: collapse;
}
td,th {
border : 1px solid green;
padding: 10px;
}
th {
width: 130px;
text-align: center;
background-color: green;
color: white;
}
h1 {
color : green;
}
</style>
<script type="text/javascript">
function remove(){
var oriPw = '${bvo.pw}';
var ckPw = document.querySelector("#inPw");
if(oriPw == ''){
alert("비밀번호를 입력하세요.");
f.pw.focus();
return;
}
if(oriPw != ckPw.value){
alert("비밀번호가 다릅니다.");
return;
}
if(confirm("게시글을 삭제하시겠습니까?")){
location.href='/chapter99/BBSController?cmd=remove';
}
}
</script>
</head>
<body>
<div>
<h1>${bvo.b_idx } 번 게시글 삭제</h1>
<table>
<tbody>
<tr>
<th>작성자</th>
<td>${bvo.writer }</td>
</tr>
<tr>
<th>제목</th>
<td>${bvo.title }</td>
</tr>
<tr>
<th>비밀번호</th>
<td><input type="password" name="pw" size="80" id="inPw"></td>
</tr>
<tr>
<td colspan="2">
<input type="button" value="게시글 삭제" onclick="remove()">
<input type="reset" value="다시 작성">
<input type="button" value="게시글로 이동" onclick="history.go(-1)">
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>