forked from Shrouk-Fathy/Web-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.html
210 lines (156 loc) · 7.45 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!-- signup.html -->
<!-- <!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>HomEleganta</title>
<link rel="stylesheet" href="signup.css">
<link rel="icon" href="./image/icon.png">
<!-- bootstrap link -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- icons -->
<link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head>
<body>
<div id="header"></div>
<div id="home">
<!-- navbar top -->
<div class="container">
<div class="navbar-top">
<div class="social-link">
<i><img src="./image/twitter.png" alt="" width="30px"></i>
<i><img src="./image/facebook.png" alt="" width="30px"></i>
<i><img src="./image/google-plus.png" alt="" width="30px"></i>
</div>
<div class="logo">
<h3>Hom<span>E</span>leganta</h3>
</div>
<div class="icons">
<i><img src="./image/search.png" alt="" width="20px"></i>
<i><img src="./image/heart.png" alt="" width="20px"></i>
<i><img src="./image/shopping-cart.png" alt="" width="25px"></i>
</div>
</div>
</div>
<!-- navbar top -->
<!-- main content -->
<div class="main-content">
<nav class="navbar navbar-expand-md" id="navbar-color">
<div class="container">
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span><i><img src="./image/menu.png" alt="" width="30px"></i></span>
</button>
<!-- Navbar links -->
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav" >
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html#shop">Shop</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html#contact">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="signup.html">Sign UP</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="boxform">
<h1>
<span>S</span>
<span>I</span>
<span>G</span>
<span>N</span>
<span>U</span>
<span>P</span>
</h1>
<form class= "signup" id="signupForm" action="index.html" onsubmit="validation(event)" novalidate>
<div class="input-bar">
<i class='bx bx-user'></i>
<input name="fullName" id="fullName" placeholder="Full Name" >
</div>
<div class="input-bar">
<i class='bx bx-envelope'></i>
<input type="email" name="email" id="email" placeholder="Email" >
</div>
<div class="input-bar">
<i class='bx bx-lock-alt' ></i>
<input type="password" name="pass" id="password" placeholder="Password">
</div>
<div class="input-bar">
<i class='bx bx-lock-alt' ></i>
<input type="password" name="confirmPass" id="confirmPassword" placeholder="Confirm Password" >
</div>
<input type="submit" value="Sign Up">
</form>
<span> Already have an account? <a href="login.html">Log In</a></span>
</div>
</div>
</div>
</div>
<script>
//$("#header").load("header.html");
function validation(e){
var Name = document.getElementById("fullName");
var Email = document.getElementById("email");
var Password = document.getElementById("password");
var ConfirmPassword = document.getElementById("confirmPassword");
e.preventDefault(); // Prevents the default form submission
var emailRegx= /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(Name.value === "" || isFinite(Name.value) || Email.value === "" || !emailRegx.test(Email.value)){
if(Name.value === ""){
alert("Please enter your name") ;
}
else if(isFinite(Name.value)){
alert("Please enter only char type in the name field") ;
Name.value = "";
}
if(Email.value === ""){
alert("Please enter your email") ;
}
else if(!emailRegx.test(Email.value)){
alert("That email not valid") ;
Email.value = "";
}
}
else{
if(Password.value === "")
{
alert("Please enter your password");
}
else if(Password.value.length < 8)
{
alert("Password must be 8 characters long");
}
else
{
if(Password.value !== ConfirmPassword.value){
alert("Password not match");
ConfirmPassword.value = "";
}
else{
alert("SignUp Successfully");
window.location.assign("index.html");
}
}
}
}
</script>
</body>
</html>