-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignUp.html
More file actions
103 lines (99 loc) · 2.85 KB
/
Copy pathsignUp.html
File metadata and controls
103 lines (99 loc) · 2.85 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!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>
form{
width: 300px;
display: grid;
grid-template-columns: repeat(1,fr);
gap: 10px;
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
margin: auto;
padding: 5%;
background-color: antiquewhite;
border-radius: 10px;
}
#submit:hover{
background-color: blue;
color: white;
font-size: medium;
border-radius: 5px;
border: 0ch;
cursor: pointer;
}
body{
background-color: wheat
}
input{
border: 0px;
color: brown;
font-size: small;
}
button{
background-color: white;
color: black;
border-radius: 5px;
border: 0ch;
}
button:hover{
background-color: blue;
color: white;
font-size: medium;
border-radius: 5px;
border: 0ch;
cursor: pointer;
}
a:hover{
background-color: blue;
color: white;
font-size: medium;
border-radius: 5px;
border: 0ch;
cursor: pointer;
}
</style>
</head>
<body>
<form>
<h1>Sign Up</h1>
<label>Name</label>
<input id="name" placeholder="Enter Full Name" type="text"/>
<label>Phone Number</label>
<input id="mob" placeholder="Number" type="number"/>
<label>Email</label>
<input id="email" placeholder="Email" type="text"/>
<label>Password</label>
<input id="password" placeholder="Password" type="password"/>
<label>Country</label>
<input id="country" placeholder="Country" type="text"/>
<input id="submit" type="submit" value="Submit">
</form>
</body>
</html>
<script>
let admin_form=document.querySelector('form');
admin_form.addEventListener('submit',myfun)
let adminData=JSON.parse(localStorage.getItem("user"))||[]
function myfun(event){
event.preventDefault();
let Obj={
name:admin_form.name.value,
mob:admin_form.mob.value,
email:admin_form.email.value,
password:admin_form.password.value,
country:admin_form.country,
}
if(Obj.name==""||Obj.email==""||Obj.phone==""||Obj.gender==""||Obj.course==""){
alert("Please fill all the details")
}else{
alert("Sign In Complete")
adminData.push(Obj)
localStorage.setItem("user",JSON.stringify(adminData))
alert(window.location.href="./logIn.html")
}
}
</script>