-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
156 lines (145 loc) · 8.65 KB
/
index.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
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light back bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#" style="color: white;">Navbar</a>
<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="#" style="color: white;">Home <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4 userregister">
<h3 class="headingstyle text-center">
<i class="fa fa-plus-circle" aria-hidden="true"></i>
Register
</h3>
<div class="mb-3 mt-4">
<label class="form-label">First Name</label>
<input type="text" id="firstname" class="form-control" placeholder="please enter your firstname">
<p class="mt-2 alert-text" id="firstname-error-messages"></p>
</div>
<div class="mb-3">
<label class="form-label">Last Name</label>
<input type="text" id="lastname" class="form-control" placeholder="please enter your lastname">
<p class="mt-2 alert-text" id="lastname-error-messages"></p>
</div>
<div class="mb-3">
<label class="form-label">Email address</label>
<input type="email" id="email" class="form-control" placeholder="please enter your email id">
<p class="mt-2 alert-text" id="email-error-messages"></p>
</div>
<div class="mb-3">
<label class="form-label">Password</label>
<input type="password" id="password" class="form-control" placeholder="please enter your password">
<p class="mt-2 alert-text" id="password-error-messages"></p>
</div>
<div class="mb-3 mt-5">
<button type="button" id="submit-btn1" onclick="register()" disabled='disabled' class="btn btn-primary btn-style">Register</button>
</div>
<div class="text-center">
Do you have an account? <a href="login.html">Sign in</a>
</div>
<div class="text-center">
<a href="welcome.html">Skip</a>
</div>
</div>
<div class="col-md-4"></div>
</div>
</div>
<script>
var firstname_flag = false;
var lastname_flag = false;
var email_flag = false;
var pass_flag = false;
$(document).ready(function(){
var emailes = document.getElementById('email')
var firstname = document.getElementById('firstname')
var password = document.getElementById('password')
var lastname = document.getElementById('lastname')
emailes.addEventListener("keyup", () => {
var mailformat = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var emailes = document.getElementById('email').value
console.log(emailes);
if(emailes.match(mailformat)){
document.getElementById('email-error-messages').innerHTML = '';
email_flag = true;
console.log(email_flag)
}else {
document.getElementById('email-error-messages').innerHTML = 'not valid email';
email_flag = false;
console.log(email_flag)
}
enablebutton()
});
firstname.addEventListener("keyup", () => {
console.log("yes");
var str = /[A-Za-z]/g
var firstname = document.getElementById('firstname').value
if(firstname.length > 1 && firstname.match(str) ){
document.getElementById('firstname-error-messages').innerHTML = '';
firstname_flag = true;
}else {
document.getElementById('firstname-error-messages').innerHTML = 'please provide valid first name';
firstname_flag = false;
}
enablebutton()
});
lastname.addEventListener("keyup", () => {
console.log("yes");
var str = /[A-Za-z]/g
var lastname = document.getElementById('lastname').value
if(lastname.length > 1 && lastname.match(str) ){
document.getElementById('lastname-error-messages').innerHTML = '';
lastname_flag = true;
}else {
document.getElementById('lastname-error-messages').innerHTML = 'please provide valid last name';
lastname_flag = false;
}
enablebutton()
});
password.addEventListener("keyup", () => {
console.log("yes");
var str = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*?&])([a-zA-Z0-9@$!%*?&]{8,})$/g
var password = document.getElementById('password').value
if(password.length >= 8){
document.getElementById('password-error-messages').innerHTML = '';
pass_flag = true;
}else {
document.getElementById('password-error-messages').innerHTML = 'please provide valid password';
pass_flag = false;
}
enablebutton()
});
function enablebutton(){
if(firstname_flag && email_flag && lastname_flag && pass_flag){
document.getElementById('submit-btn1').removeAttribute('disabled');
}else {
document.getElementById('submit-btn1').setAttribute('disabled', 'disabled');
}
}
});
</script>
<script src="video/videoplayer.js?v=167"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
</body>
</html>