-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoin.js
More file actions
44 lines (42 loc) · 1.4 KB
/
join.js
File metadata and controls
44 lines (42 loc) · 1.4 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
let id = document.getElementById("id");
let pw = document.getElementById("pw");
let pwcheck = document.getElementById("pwcheck");
let name = document.getElementById("name");
let email = document.getElementById("email");
function inputcheck() {
var id_check = new RegExp(/^([A-Za-z0-9]){6,15}$/);
var pass_check = new RegExp(/^.*(?=^.{8,15}$)(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&+=]).*$/);
if(id_check.test(id.value) && pass_check.test(pw.value)) {
return true;
} else {
return false;
}
}
$("#btn").click(function() {
if(inputcheck()) {
if(pw != pwcheck) {
$.ajax({
url: 'join.php',
type: 'POST',
data: {
id : id.value,
pw : pw.value,
name: name.value,
email: email.value,
phone: $("#phone").val()
},
success: function(data) {
alert("회원가입 성공!");
location.href = "main.html";
},
error: function(e) {
alert(e.reponseText);
}
})
} else {
alert("비밀번호화 비밀번호 확인이 다릅니다.");
}
} else {
alert("아이디와 비밀번호를 확인해주세요.");
}
})