-
Notifications
You must be signed in to change notification settings - Fork 0
/
write.html
84 lines (66 loc) · 2.04 KB
/
write.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
</style>
<script src="https://cdn.ckeditor.com/4.10.1/standard/ckeditor.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
//문서가 로드되면
$(function(){
//기존 textarea의 디자인을 교체
CKEDITOR.replace( "content");
//입력한 데이터를 서버에 전송하기!!
//http method : Get, Post, Update, Delete..
//입력양식에 의할 경우 post 방식으로 전송
//post는 데이터량에 한계 없고, 파라미터가 (즉, 변수가) 브라우저 주소에 표현되지 않아 보안 처리됨
$("input[type=button]").click(function(){
$("form").submit(); //전송!
});
});
</script>
</head>
<body>
<h3>Contact Form</h3>
<div class="container">
<form method="POST" action="/board/write">
<label for="fname">작성자</label>
<input type="text" id="writer" name="writer" placeholder="작성자">
<label for="lname">제목</label>
<input type="text" id="title" name="title" placeholder="제목 입력">
<label for="subject">내용</label>
<textarea id="content" name="content" placeholder="내용 입력..." style="height:200px"></textarea>
<input type="button" value="전송">
</form>
</div>
</body>
</html>