<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">

function check(){
	
	var name = document.getElementById("name");
	var subject = document.getElementById("subject");
	var password = document.getElementById("password");
	var content = document.getElementById("content");
	
	var forms = document.getElementById("updateForm");
	
	if(name.value.length == 0 || name.value ==""){
		alert("이름을 입력해주세요");
		forms.name.focus();
		return false;
	}
	
	if(subject.value.length == 0 || subject.value ==""){
		alert("제목을 입력해주세요");
		forms.subject.focus();
		return false;
	}
	
	if(password.value.length == 0 || password.value ==""){
		alert("비밀번호를 입력해주세요");
		forms.password.focus();
		return false;
	}
	
	if(content.value.length == 0 || content.value ==""){
		alert("내용을 입력해주세요");
		forms.content.focus();
		return false;
	}
	
}


</script>
<script src="IDC/js/setToken.js"></script>
<!-- 여기가 본 페이지이다 -->
<div class="row">
	<div class="col-lg-8">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h4><i class="fa fa-desktop fa-fw"></i> 게시판 글 수정</h4>
			</div>
			<form action="boardUpdate.bor" name="updateForm" id="updateForm" method="post" onsubmit="return check();">
				<input type="hidden" id="token" name="token">
				<div class="panel-body">
					<div class="input-group">
							<input type="hidden" name="num" value="${boardUpdateForm.num}">
						<div class="input-group-btn">
							<a class="btn btn-default btn-outline" href="boardSearch.bor?searchOption=name&searchWord=${member.name }">목록으로</a>
						</div>
					</div>
					<!-- row -->
			   			<div class="table-responsive">
							<table style="margin-bottom:0px;" class="table table-bordered table-hover table-striped">
								<thead>
								</thead>
								<tbody>
									<tr>
										<td>글 제목</td>
										<td colspan="3">
											<input type="text" class="form-control" name="subject" id="subject" maxlength="50" size="50" value="${boardUpdateForm.subject}">
										</td>
									</tr>
									<tr>
										<td>작성자</td>
										<td>
											<input type="text" class="form-control" name="name" id="name" maxlength="20" size="20" value="${boardUpdateForm.name}">
										</td>
										<!-- <td>비밀번호</td>
										<td>
											<input type="password" class="form-control" name="password" id="password" maxlength="20" size="12">
										</td>-->
										<input type="hidden" class="form-control" name="password" id="password" maxlength="20" size="12" value="1234">
									</tr>
									<tr>
										<td>본문</td>
										<td colspan="3">
											<textarea name="content" class="form-control" rows="30"class="form-control" id="content">${boardUpdateForm.content}</textarea>
										</td>
									</tr>
								</tbody>
								<tfoot>
								</tfoot>
							</table>
						</div>
						<!-- table-responsive -->
						<div class="row">
							<div class="col-lg-12">
								<input class="btn btn-primary btn-outline" type="submit" value="수정">
							</div>
						</div>
					</div>
					<!-- panel-body -->
				</form>
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
