Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
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 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

insert_page.jsp 본문

JSP/JSP.sideproject

insert_page.jsp

GAWON 2023. 6. 23. 12:46
<%@ 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>Insert title here</title>
<!-- insert 게시글 작성 -->
<style type="text/css">
	div{
		width: 800px;
		margin: auto;
	}
	table{
		width: 100%;
		text-align: left;
		border-collapse: collapse;
	} 
	td,th{
		border: 1px solid green;
		padding: 10px;
	}
	th{
		background-color: green;
		color: #fff;
		text-align: center;
	}
	#btn{
		text-align: center;
	}
	.readonly{
		background-color: lightgray;
	}
</style>
<script type="text/javascript">
	function insert(f){
		if(f.title.value ==''){
			alert("제목을 입력하세요.");
			return;
		}
		if(f.pw.value == ''){
			alert("비밀번호를 입력하세요.");
			return;
		}
		if(f.content.value ==''){
			alert("내용을 입력하세요.");
			return;
		}
	
		f.submit();
	}
	function view_all(){
		var cp = '${currentPage}';
		location.href='BBSController?cmd=allList&currentPage=' + cp;
	}
</script>
</head>
<body>
	<div>
		<h2>게시글 작성</h2>
		<form action="/chapter99/BBSController" method="post" enctype="multipart/form-data">
			<table>
				<tbody>
					<tr>
						<th>작성자</th>
               			<td><input type="text" name="writer" size="80"value="${member.mid }" class="readonly" readonly></td>
					</tr>
					<tr>
						<th>제목</th>
						<td><input type="text" name="title" size="80"></td>
					</tr>
					<tr>
						<th>비밀번호</th>
						<td><input type="password" name="pw" size="80"></td>
					</tr>
					<tr>
						<th>첨부파일</th>
						<td><input type="file" name="filename"></td>
					</tr>
					<tr>
						<th>내용</th>
						<td><textarea rows="10" cols="80" name="content" placeholder="내용을 입력하세요"></textarea></td>
					</tr>
					<tr>
						<td colspan="2" id="btn">
							<input type="button" value="게시글 저장" onclick="insert(this.form)">&nbsp;&nbsp;
							<input type="reset" value="다시 작성">&nbsp;&nbsp;
							<input type="button" value="목록으로 이동" onclick="view_all()">
							<input type="hidden" name="cmd" value="insertBBS">
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
</body>
</html>

'JSP > JSP.sideproject' 카테고리의 다른 글

remove_comment.jsp  (0) 2023.06.23
insert.jsp  (0) 2023.06.23
insert_comment.jsp  (0) 2023.06.23
download.jsp  (0) 2023.06.23
allList.jap  (0) 2023.06.23