-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup1.html
92 lines (84 loc) · 2.86 KB
/
signup1.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
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.container{
width: 400px;
height:580px;
margin-top: 100px;
margin-left: 540px;
border-radius: 20px;
box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
border: 1px solid white;
text-align: center;
/* height: 100vh; */
}
.container>#but{
width: 300px;
height: 35px;
/* border-radius: 20px; */
background-color: rgb(177, 18, 18);
color: white;
font-weight:bold;
font-size: 20px;
border: 1px solid white;
}
.big{
width:300px;
height:25px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>Register New Account</h1>
<label> First Name </label><br>
<input class="big" type="text" name="" id="naam" placeholder="Enter First Name"><br><br>
<label> Last Name </label><br>
<input class="big" type="text" name="" id="last" placeholder="Enter Last Name"><br><br>
<label>Email Address</label><br>
<input class="big" type="text" id="ema" placeholder="Enter Email"><br><br>
<label for="">Mobile no.</label><br>
<input class="big" id="num" type="number"placeholder="Enter Mobile Number"><br><br>
<label>Password</label><br>
<input class="big" type="password" id="password" placeholder="Create Password (atleast 8 characters)"><br><br>
<label>Confirm Password</label><br>
<input class="big" type="text" id="cnf" placeholder="Confirm Password"><br>
<p>Already Registered? <a style="color: red;" href="signin1.html">LOGIN</a> </p>
<button id="but"> SIGN UP </button>
</div>
</body>
</html>
<script>
document.querySelector("button").addEventListener("click", fun2);
let arr= JSON.parse(localStorage.getItem("cart"))||[];
function fun2() {
let name = document.querySelector("#naam").value;
let last = document.querySelector("#last").value;
let email = document.querySelector("#ema").value;
let mobile = document.querySelector("#num").value;
let password = document.querySelector("#password").value;
let confirm = document.querySelector("#cnf").value;
if( password!==confirm ){
alert("Wrong Password ");
return;
}else{
let dataobj={
name,
last,
email,
mobile,
password,
confirm,
};
arr.push(dataobj);
localStorage.setItem("cart",JSON.stringify(arr))
window.location.href="signin1.html";
}
}
</script>