forked from Taewan-P/military-duty-calc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (83 loc) · 3.52 KB
/
index.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
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Military Duty Calculator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="hayeong">
<meta name="description" content="Calcurate a date of user's discharge">
<meta name="copyright" content="BSD-3-Clause">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<!-- <script src="index.js"></script> -->
<!-- jQuery UI CSS파일 -->
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" type="text/css" />
<!-- jQuery 기본 js파일 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- jQuery UI 라이브러리 js파일 -->
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
<script>
window.onload = () => {
$(function() {
$( "#Datepicker" ).datepicker({
dateFormat: "yy/mm/dd",
showOtherMonths: true,
});
});
function buttonClick() {
var datepick = document.getElementById("Datepicker").val();
var army_select = document.getElementById("army_select").val();
if (!datepick) { alert("날짜를 입력하세요"); }
else if (army_select == "") { alert("군별을 선택하세요"); }
else {
window.location.href='result.html';
}
}
}
</script>
</head>
<body>
<script>
$(function() {
$( "#Datepicker" ).datepicker({
dateFormat: "yy/mm/dd",
showOtherMonths: true,
});
});
function buttonClick() {
if($('#Datepicker').val() == ""){
alert("날짜를 입력하세요!");
}
else if($('#army_select option:selected').val() == 'none'){
alert("군별을 입력하세요!");
}
else{
window.location.href='result.html?date=' + $('#Datepicker').val() + "&month=" + $('#army_select option:selected').val();
}
// else {
// window.location.href='result.html';
// }
}
</script>
<div class="main_title" align="center">
<header>
<h1>당신의 입대 날짜를 적어주세요.</h1>
</header>
</div>
<div id="selection">
<form mehtod='get' action="result.html" name="input_form">
<p>날짜: <input type="text" id="Datepicker" readonly="true" autocomplete="off" name='date'></p>
<select id="army_select" name='army_select'>
<option value="none" selected="selected">군별선택</option>
<option value="21">육군/의경</option>
<option value="23">해군/해양의무경찰</option>
<option value="24">공군</option>
<option value="21">해병</option>
<option value="24">사회복무요원</option>
<option value="23">의무소방</option>
</select>
<input id="continue" type="button" name="submit" onclick="javascript:buttonClick();" value="계속">
</form>
</div>
</body>
</html>