-
Notifications
You must be signed in to change notification settings - Fork 10
/
signup.html
229 lines (189 loc) · 7.18 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<html>
<head>
<title>MedicInfo | Sign Up</title>
<link rel="stylesheet" type="text/css" href="signup.css"/>
<meta charset="utf-8"/>
<link rel="stylesheet" href="signup.css">
</head>
<body>
<div class="border"></div>
<div class="medictab">
<h3>MedicInfo <p style="text-decoration:none;">Saving Lives | Protecting People | Sharing Knowledge</p></h3>
<form>
<input type="text" name="search" placeholder="Search MedicInfo..." size="30"/>
<input type="submit" value="Search" />
</form>
</div>
<div class="navigation">
<ul>
<li><a href="index.html">Home</a></li>
<li class="dropdown">
<a href="quiz.html" class="dropbtn">Quizzes</a>
<div class="dropctn">
<a href="diseasequiz.html">Quiz on Diseases</a>
<a href="medicinequiz.html">Quiz on Medicines</a>
</div>
</li>
<li class="dropdown">
<a href="disease.html" class="dropbtn">Diseases</a>
<div class="dropctn">
<a href="adenoinf.html">Adenovirus Infection</a>
<a href="sleepsick.html">Sleeping Sickness</a>
<a href="arthritis.html">Arthritis</a>
<a href="disease.html">More...</a>
</div>
</li>
<li class="dropdown">
<a href="medicine.html" class="dropbtn">Medicines</a>
<div class="dropctn">
<a href="">Vitamin B12</a>
<a href="">Metformin</a>
<a href="">Analgesics</a>
<a href="medicine.html">More...</a>
</div>
</li>
<li><a href="sympcheck.html">Symptom Checker</a></li>
<li><a href="about.html">About Us</a></li>
<li id="flr"><a href="login.html">Login</a></li>
<li id="flr"><a href="signup.html" style="border-left: 1px solid powderblue;" class="active">Sign Up</a></li>
</ul>
</div>
<br/>
<p id="toppara">
Register With the World of MedicInfo and Enjoy Benefits like Symptom Checker and Online Quiz...<br/>
<span style="font-size: 18px;">It is simple, we need basic information only!!</span>
</p>
<br/>
<form name="regform" method="post" class="formcss">
<fieldset>
<legend style="letter-spacing: 1px; font-family: Helvetica; font-size: 20px; color: #C40000; font-weight: bold;">Register With MedicInfo</legend>
Name : <br/>
<input type="text" name="fname" value="" placeholder="First Name / UserName" title="Enter your First name" /> 
<input type="text" name="lname" value="" placeholder="Last Name" title="Enter your Last name"><br>
<span id="fnameerr"></span> 
<span id="lnameerr"></span><br/>
Email Address : <br/><input type="email" name="email" value="" placeholder="Enter your E-mail" title="Enter Valid E-Mail" /><br><span id="emailerr"></span><br/>
Date Of Birth (optional) : <br/><br/><input type="date" name="dob" value=""/><br><span id="doberr"></span><br/>
Age : <br/>
<input type="number" name="age" value="" min="12" required="required"/><br/><br/>
Sex :<br><label for="male" style="font-size: 16px;">Male</label><input type="radio" name="sex" id="male" value="male">
<label for="female" style="font-size: 16px;">Female</label><input type="radio" name="sex" id="female" value="female">
<br/><span id="sexerr"></span><br/>
Blood Group : <br/><input type="text" name="bldgroup" placeholder="Your Blood Group" title="Enter your Blood Group" /><br><span id="bldgerr"></span><br/>
Password : <br/><input type="password" name="password" placeholder="Password" title="Password should be of length greater than 8" /><br><span id="passerr"></span><br/>
Confirm Password : <br/><input type="password" name="re_password" placeholder="Re-enter Password" title="Type the same Password as above" /><br><span id="confpasserr"></span><br/>
<input type="submit" name="submit" value="Register" onclick="return validate(this.form)" /> 
<input type="reset" name="Reset" />
</fieldset>
</form>
<script type="text/javascript">
var refname = document.getElementById("fnameerr");
var relname = document.getElementById("lnameerr");
var reemail = document.getElementById("emailerr");
var redob = document.getElementById("doberr");
var regen = document.getElementById("sexerr");
var repass = document.getElementById("passerr");
var rebldg = document.getElementById("bldgerr");
var reconf = document.getElementById("confpasserr");
function validate(form) {
// body...
var text = "";
if (form.fname.value=="" ) {
text = "First name cannot be empty";
refname.innerHTML = text;
form.fname.value = "";
return false;
}
if(form.fname.value.match(/[0-9]/)) {
text = "First name cannot contain numbers";
refname.innerHTML = text;
form.fname.value = "";
return false;
}
if(form.fname.value!="" && !form.fname.value.match(/[0-9]/)) {
refname.innerHTML = "";
}
if (form.lname.value=="" ) {
text = "Last name cannot be empty";
relname.innerHTML = text;
form.lname.value = "";
return false;
}
if(form.lname.value.match(/[0-9]/)) {
text = "Last name cannot contain numbers";
relname.innerHTML = text;
form.lname.value = "";
return false;
}
if(form.lname.value!="" && !form.lname.value.match(/[0-9]/)) {
relname.innerHTML = "";
}
if(form.email.value=="" || form.email.value.indexOf('@',0)==-1 || form.email.value.indexOf('.')==-1 || form.email.value.indexOf('.')==0) {
text = "Enter valid E-mail";
reemail.innerHTML = text;
form.email.value = "";
return false;
}
if(form.email.value!="" && form.email.value.indexOf('@',0)!=-1 && form.email.value.indexOf('.')!=-1 && form.email.value.indexOf('.')!=0) {
reemail.innerHTML = "";
}
if (form.sex[0].checked==false && form.sex[1].checked==false) {
text = "Please choose your Sex";
regen.innerHTML = text;
return false;
}
if (form.sex[0].checked==true || form.sex[1].checked==true) {
regen.innerHTML = "";
}
if (form.bldgroup.value=="") {
text = "Blood Group cannot be empty";
rebldg.innerHTML = text;
form.bldgroup.value = "";
return false;
}
if (!form.bldgroup.value.match(/^(A|B|O|AB)[+-]$/)) {
text = "Enter Valid Blood Group";
rebldg.innerHTML = text;
form.bldgroup.value = "";
return false;
}
if (form.bldgroup.value.match(/^(A|B|O|AB)[+-]$/)) {
rebldg.innerHTML = "";
}
if (form.password.value.toString().length<9) {
text = "Password should contain atleast 9 letters";
repass.innerHTML = text;
form.password.value = "";
return false;
}
if (form.password.value.toString().length>8) {
repass.innerHTML = text;
}
if ((form.re_password.value.toString()).localeCompare(form.password.value.toString())!=0) {
text = "Password not matching";
reconf.innerHTML = text;
form.re_password.value = "";
return false;
}
if ((form.re_password.value.toString()).localeCompare(form.password.value.toString())==0) {
reconf.innerHTML = "";
}
alert("Form Submitted");
return true;
}
</script>
<br/><br/><br/><br/><br/><br/>
<div id="footer">
<p style="text-align: center; font-size: 11px;">Thank you for visiting</p>
<p style="text-align: center;">MEDICINFO</p>
<p style="font-size: 11px; text-align: center;">Contact Us | Visit Again | Stay Healthy</p>
<hr/>
<p style="color: #DCFFFE; margin-left: 10px; font-size: 19px;">Maintained By: -
<ul id="credits">
<li>Kunal</li>
<li>Kanishk</li>
<li>Siddharth</li>
</ul></p>
</div>
</body>
</html>