-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
157 lines (113 loc) · 4.02 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
157
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>signup</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script>
function validation(){
try {
// alert("hh");
// return false
var firstname = document.getElementById("firstname").value;
var lastname = document.getElementById("lastname").value;
var email = document.getElementById("email").value;
var password = document.getElementById("password").value;
var phonenumber = document.getElementById("phonenumber").value;
var practice = document.getElementById("practice").value;
var role = document.getElementById("role").value;
var checkbox = document.getElementById("checkbox").checked;
firstname = firstname.trim();
lastname = lastname.trim();
email = email.trim();
password = password.trim();
phonenumber = phonenumber.trim();
practice = practice.trim();
role = role.trim();
if(firstname=="" || lastname=="" || email=="" || password=="" ||phonenumber
=="" || practice=="" || role=="" || !checkbox){
if(firstname=="" && lastname=="" && email=="" && password=="" &&
phonenumber=="" && practice=="" && role=="" || !checkbox ){
alert("All field are mandatory");
return false;
}
if(firstname==""){
alert("please enter first name" );
return false;
}
if(lastname==""){
alert("please enter last name" );
return false;
}
if(email==""){
alert("please enter email" );
return false;
}
if(password==""){
alert("please enter password" );
return false;
}
if(phonenumber==""){
alert("please enter phonenumber" );
return false;
}
if(practice==""){
alert("please enter Practice field" );
return false;
}
if(role==""){
alert("please enter role" );
return false;
}
if(checkbox==""){
alert("please tick in checkbox" );
return false;
}
}
else{
alert("all good");
return true;
}
} catch (error) {
alert(error);
return false;
}
}
</script>
<div class="outer">
<div class="inner">
<div id="signup">
Sign Up
</div>
<div>
<input type="text" id="firstname" placeholder="First Name">
<input type="text" id="lastname" placeholder="Last Name">
</div>
<div>
<input type="email" id="email" placeholder="Email">
</div>
<div>
<input type="password" id="password" placeholder="Password">
</div>
<div >
<input type="number" id="phonenumber" placeholder="Phone Name">
</div>
<div>
<input type="text" id="practice" placeholder="Practice Field">
</div>
<div>
<input type="text" id="role" placeholder="Role">
</div>
<div>
<input type="checkbox" id="checkbox">
<span> You agree to our Terms Privacy Policy</span>
</div>
<div>
<button type="submit" id="button" onclick="validation()">Send</button>
</div>
</div>
</body>
</html>