-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsignup.html
74 lines (68 loc) · 2.41 KB
/
signup.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
<!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">
<link rel="stylesheet" href="./styles/header.css">
<link rel="stylesheet" href="./styles/footer.css">
<title>Document</title>
<link rel="stylesheet" href="signup.css">
</head>
<body>
<div id="navbar"></div>
<div id="register">
<p class="para">Register</p>
<hr class="line">
<form>
<input type="text" placeholder="First Name*" id="firstname">
<br><br>
<input type="text" placeholder="Last Name*" id="lastname">
<br><br>
<input type="text" placeholder="Email Address*" id="email">
<br><br>
<input type="text" placeholder="Password*" id="password">
<br><br>
<input type="text" placeholder="Confirm Password*" id="confirmpassword">
<br><br>
<input type="Number" placeholder="Mobile No*" id="mobile">
</form>
<br><br>
<button>Register</button>
<div id="char">
<p>Already Registered?</p>
<a href="login.html" class="login"><p >Login</p></a>
</div>
</div>
<div id= 'footer'></div>
</body>
</html>
<script>
document.querySelector("button").addEventListener("click",register);
let userdata=JSON.parse(localStorage.getItem("userdatabase"))||[];
function register(){
let firstname=document.querySelector("#firstname").value;
let lastname=document.querySelector("#lastname").value;
let email=document.querySelector("#email").value;
let password=document.querySelector("#password").value;
let confirmpassword=document.querySelector("#confirmpassword").value;
let mobile=document.querySelector("#mobile").value;
let usercred={
fname:firstname,
lname:lastname,
emailId:email,
pass:password,
confpass:confirmpassword,
mobile:mobile,
};
userdata.push(usercred);
localStorage.setItem("userdatabase",JSON.stringify(userdata));
window.location.href="login.html";
}
</script>
<script type="module">
import footer from "./components/footer.js"
import navbar from "./components/navbar.js"
document.querySelector("#navbar").innerHTML=navbar();
document.querySelector("#footer").innerHTML=footer();
</script>