-
Notifications
You must be signed in to change notification settings - Fork 2
/
SginUP.html
58 lines (51 loc) · 2.05 KB
/
SginUP.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bungee+Spice&family=Caveat:[email protected]&family=Dancing+Script:[email protected]&display=swap" rel="stylesheet">
</head>
<body class="signup-body">
<div class="container" >
<form class="signup-form2">
<h1>Sign Up</h1>
<label for="Username" class="USN" >Username</label>
<input type="text" placeholder="Username" id="s-username" required>
<label for="Email" class="Email" >Email</label>
<input type="email" placeholder="Email" id="s-email" required>
<label for="Password" class="Password" >Password</label>
<input type="password" placeholder="Password" id="s-psswd" required>
<label for="Confirm Password" class="CP" >Confirm</label>
<input type="password" placeholder="Confirm Password" required>
<button type="button" onclick="storeData()" class="sign-bott">Sign Up</button>
</form>
</div>
</body>
<script>
function storeData(){
let name , email , password;
name = document.getElementById("s-username").value;
email=document.getElementById("s-email").value;
password = document.getElementById("s-psswd").value;
let users_array = Array();
users_array = JSON.parse(localStorage.getItem("users"))?JSON.parse(localStorage.getItem("users")):[]
if(users_array.some((v)=>{
return v.email == email;
})){
alert("this email is allready exist .... Login instead");
}else{
users_array.push({
"name":name,
"email":email,
"password":password
})
localStorage.setItem("users" , JSON.stringify(users_array))
window.location.href = "Login.html"
}
}
</script>
</html>