join.ejs
3.49 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
<% include ../includes/header.ejs %>
<div class="w-25 border border-info border-3" style="position: absolute; left: 37%; top: 17%;">
<div>
<div>
<div style="padding-top: 5%; padding-left: 5%;">
<h3 class="panel-title">회원가입</h3>
</div>
<div class="panel-body">
<form role="form" action="" id="join_form" method="post">
<fieldset>
<div class="w-100" style="padding-left: 5%; padding-right: 5%;">
<input class="form-control" placeholder="ID" name="username" type="text" autofocus="" required="">
</div>
<div class="w-100" style="padding-left: 5%; padding-right: 5%;padding-top: 3%">
<input class="form-control" placeholder="Password" name="password" type="password" value="" required="">
</div>
<div class="w-100" style="padding-left: 5%; padding-right: 5%;padding-top: 3%">
<input class="form-control" placeholder="Password 확인" name="password2" type="password" value="" required="">
</div>
<div class="w-100" style="padding-left: 5%; padding-right: 5%;padding-top: 3%">
<input class="form-control" placeholder="이름" name="displayname" type="text" value="" required="">
</div>
<!-- Change this to a button or input when using this as a form -->
<div class="d-grid gap-2 col-11 mx-auto p-2">
<input type="submit" class="btn btn-lg btn-success btn-block" value="가입하기">
<a href="/auth/google" class="btn btn-lg btn-danger btn-block">
<i class="fa fa-google" aria-hidden="true"></i> Google 회원가입
</a>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
(function(){
$(document).ready(function() {
$('#join_form').submit(function(){
var $usernameInput = $('#join_form input[name=username]');
var $passwordInput = $('#join_form input[name=password]');
var $passwordInput2 = $('#join_form input[name=password2]');
var $displayname = $('#join_form input[name=displayname]');
if(!$usernameInput.val()){
alert("아이디를 입력해주세요.");
$usernameInput.focus();
return false;
}
if(!$passwordInput.val()){
alert("패스워드를 입력해주세요.");
$passwordInput.focus();
return false;
}
if(!$passwordInput2.val()){
alert("확인 패스워드를 입력해주세요.");
$passwordInput2.focus();
return false;
}
if(!$displayname.val()){
alert("이름을 입력해주세요.");
$displayname.focus();
return false;
}
if($passwordInput.val() !== $passwordInput2.val()){
alert("패스워드와 확인용패스워드를 똑같이 입력해주세요.");
return false;
}
return true;
});
});
})();
</script>
<% include ../includes/footer.ejs %>