write.ejs
2.41 KB
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
<!DOCTYPE html>
<html>
<head>
<link rel = 'stylesheet' href='stylesheets/style.css'/>
<meta charset = "utf-8">
<meta http-equiv="X-UA-Compatible" content = "IE=edge">
<meta name = "viewport" content = "width=device-width, initial-scale=1">
<title><%= title %></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel = 'bootstrap' href = 'javascripts/bootstrap.js'/>
<link rel = 'jquery' href = 'javascripts/jquery-3.3.1.min.js'/>
</head>
<body>
<h1><%= title %></h1>
<form method="POST" action="/write2">
<table class = "table table-striped table-bordered table-hober">
<thead>
<tr>
<td>작성자</td>
<td><input type="text" name="creater_id" id="creater_id" required/></td>
</tr>
<tr>
<td>제목</td>
<td><input type="text" name="title" id="title" required/></td>
</tr>
<tr>
<td>내용</td>
<td><textarea name="content" id="content" cols="30" rows="10" required></textarea></td>
</tr>
<tr>
<td colspan="2">
<button type="submit">글쓰기</button>
</td>
</tr>
</tbody>
</table>
</form>
<script>
function onWriteSubmit()
{
if ( $("#creater_id").val().trim() == "" )
{
var message = "아이디를 입력해 주세요";
$("#creater_id").val("");
$("#creater_id").focus();
alert(message);
return false;
}
if ( $("#title").val().trim() == "" )
{
var message = "제목을 입력해 주세요";
$("#title").val("");
$("#title").focus();
alert(message);
return false;
}
if ( $("#content").val().trim() == "" )
{
var message = "본문 내용을 입력해 주세요";
$("#content").val("");
$("#content").focus();
alert(message);
return false;
}
}
</script>
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- 모든 컴파일된 플러그인을 포함합니다 (아래), 원하지 않는다면 필요한 각각의 파일을 포함하세요 -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</body>
</html>