-
Notifications
You must be signed in to change notification settings - Fork 3
/
signup.html
80 lines (76 loc) · 2.8 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
75
76
77
78
79
80
<!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>
<link rel="stylesheet" href="signup.css">
</head>
<body>
<div id="navbar">
<div id="left">
<div>
<a href="index.html">
<img src="https://upload.wikimedia.org/wikipedia/commons/b/bc/Myntra_Logo.png">
</a>
</div>
<div>
<div> <a href="mens.html">MEN</a></div>
<div> <a href="womens.html">WOMEN</a></div>
<div> <a href="kids.html">KIDS</a></div>
<div> <a href="Home&Living.html">HOME LIVING</a></div>
</div>
</div>
<div id="right">
<div>
<input type="text" placeholder="Search for products,brands and more">
</div>
<div>
<img src="https://static.vecteezy.com/system/resources/thumbnails/004/798/846/small/shopping-cart-logo-or-icon-design-vector.jpg">
</div>
</div>
</div>
<div id="signup_container">
<form>
<h2>Sign Up</h2>
<label for="">Full Name</label><br />
<input id="name" type="text" placeholder="Enter Your Full Name"><br />
<label for="">Email</label><br />
<input id="mail" type="text" placeholder="Enter Email"><br />
<label for="">Password</label><br />
<input id="pass" type="text" placeholder="Enter Password"><br />
<p>By signing up, I accept the Myntra<a href="https://www.myntra.com/termsofuse">Terms of
Services</a> and acknowlwdge the <a href="https://www.myntra.com/faqs#shipping">Privacy Policy</a>. </p>
<input type="submit" value="Sign up">
<p>Already have an account? <a href="signin.html">Sign in</a></p>
</form>
</div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit",myfunction);
let formtag=document.querySelector("form");
let userarr=JSON.parse(localStorage.getItem("userdata"))|| [];
function myfunction(){
event.preventDefault();
let obj={
name:formtag.name.value,
Email:formtag.mail.value,
Password:formtag.pass.value
}
if(obj.name.length<=0){
alert("Enter correct name");
return;
}else if(obj.Email.substring(obj.Email.length-4)!=".com"){
alert("Enter correct Email")
return;
}else if(obj.Password.length<8){
alert("Weak Password:Enter atleast 8 character")
return;
}
userarr.push(obj)
localStorage.setItem('userdata', JSON.stringify(userarr))
window.location.replace("signin.html")
}
</script>