-
Notifications
You must be signed in to change notification settings - Fork 7
/
fix.html
77 lines (69 loc) · 1.97 KB
/
fix.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>게시물 수정하기</title>
<link rel="stylesheet" href="./css/fix.css" />
</head>
<body>
<div id="logo" onclick="cancel()">
<a href="#"><img src="./media/logo.png" alt="로고 이미지" /></a>
</div>
<div id="write-area">
<form action="">
<div id="f-title">
<textarea name="title" id="title" rows="1"></textarea>
</div>
<hr />
<div id="f-content">
<textarea name="content" id="content"></textarea>
</div>
<div id="img">
<input type="file" name="SelectFile" accept="image" />
</div>
<div id="buttons">
<div class="fix" onclick="fix()">
<button type="submit">수정하기</button>
</div>
<div class="cancel" onclick="cancel()">
<button>취소</button>
</div>
</div>
</form>
</div>
</body>
<script>
function fix() {
var result = confirm("수정하시겠습니까?");
if (result) {
if (
document.getElementById("content").value != "" &&
document.getElementById("title").value != ""
) {
alert("수정되었습니다.");
window.location.replace("More.html");
}
if (document.getElementById("title").value == "") {
alert("제목을 입력해 주세요.");
return;
}
if (document.getElementById("content").value == "") {
alert("내용을 입력해 주세요.");
return;
}
} else {
return;
}
}
function cancel() {
var back = confirm("글 수정을 취소하시겠습니까?");
if (back) {
alert("이전으로 돌아갑니다.");
window.location.replace("More.html");
} else {
return;
}
}
</script>
</html>