-
Notifications
You must be signed in to change notification settings - Fork 0
/
valid_test1.php
290 lines (262 loc) · 7.03 KB
/
valid_test1.php
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function validateForm()
{
var college=document.forms["regform"]["college"].value;
var roll=document.forms["regform"]["roll"].value;
var roll=document.forms["regform"]["roll"].value;
//alert("oo");
var x=document.forms["regform"]["username"].value;
if (x==null || x=="")
{
alert("First name must be filled out");
//regform.username.focus();
return false;
}
var pass=document.forms["regform"]["pass"].value;
var repass=document.forms["regform"]["repass"].value;
//alert("l");
if (pass==null || repass=="")
{
alert("Password field empty");
//regform.username.focus();
return false;
}
if(pass!=repass)
{
alert("Passwords do not match");
return false;
}
var email=document.forms["regform"]["email"].value;
var atpos=email.indexOf("@");
var dotpos=email.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)
{
alert("Not a valid e-mail address");
return false;
}
var first_name=document.forms["regform"]["first_name"].value;
var last_name=document.forms["regform"]["last_name"].value;
if (first_name==null || first_name=="" || last_name==null || last_name=="")
{
alert("Name field empty");
//regform.username.focus();
return false;
}
if(isNotAlphabets(first_name))
{
alert("The first name field contains invalid characters or spaces.\n Please re-enter your last name again.");
// frm.txtLname.focus();
return false;
}
if(isNotAlphabets(last_name))
{
alert("The last name field contains invalid characters or spaces.\n Please re-enter your last name again.");
// frm.txtLname.focus();
return false;
}
//alert("p");
if (college==null || college=="")
{
alert("Please enter your college name");
//regform.username.focus();
return false;
}
if (roll==null || roll=="")
{
alert("please enter your roll");
//regform.username.focus();
return false;
}
var mobile= documents.forms["regform"]["mobile"].value;
if(documents.forms["regform"]["mobile"].value.length==0 || !isNotAlphabets(mobile) || documents.forms["regform"]["mobile"].value.length != 10 )
{
alert("Invalid Mobile number... ");
return false;
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="reg_user.php" method="POST" enctype="application/x-www-form-urlencoded" name="regform" onSubmit="return validateForm();">
<table width="800" bgcolor="#f6f6f6" align="center">
<tbody>
<tr>
<td colspan="2">Please fill in the following form to register:-<br/>
</td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Username :</td>
<td width="50%">
<input maxlength="16" name="username" type="text"> *
</td>
<!--<td width="20%">
<input name="button" onclick="check_availability()" value="Check Availability" type="button">
</td> -->
</tr>
<tr>
<td colspan="2"></td>
<td width="50%"> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Password :</td>
<td width="50%">
<input maxlength="16" name="pass" id="pass" type="password"> *
</td>
<td><font color="red" size=-3>Team Name/password should contain atleast 5 alphanumeric characters</font></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Re-type Password :</td>
<td width="50%">
<input maxlength="16" name="repass" id="repass" type="password"> *
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Email ID :</td>
<td width="50%">
<input name="email" id="mail" type="text"> *
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">First Name :</td>
<td width="50%">
<input maxlength="20" name="first_name" id="fname" type="text"> *
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Last Name :</td>
<td width="50%">
<input maxlength="20" name="last_name" type="text"> *
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Sex :</td>
<td width="50%">
<input checked="checked" name="sex" value="M" selected="selected" type="radio">
Male
<input name="sex" value="F" type="radio">
Female
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">College :</td>
<td width="50%">
<input maxlength="50" name="college" id="college" type="text"> *
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Roll No :</td>
<td width="50%">
<input maxlength="10" name="roll" id="rno" type="text"> *
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Department :</td>
<td width="50%">
<select name="dept">
<option selected="selected" value="">-Select-</option>
<option value="BT">BT</option>
<option value="CSE">CSE</option>
<option value="CE">CE</option>
<option value="CHE">CHE</option>
<option value="EE">EE</option>
<option value="ECE">ECE</option>
<option value="IT">IT</option>
<option value="ME">ME</option>
<option value="MME">MME</option>
<option value="MCA">MCA</option>
<option value="MBA">MBA</option>
</select>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td width="30%">Year :</td>
<td width="70%">
<select name="year" id="yr">
<option selected="selected" value="">-Select-</option>
<option value="First">First</option>
<option value="Second">Second</option>
<option value="Third">Third</option>
<option value="Fourth">Fourth</option>
</select>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr bgcolor="#666666">
<td>Mobile No : </td>
<td><input type="text" name="mobile" maxlength="10" />
*</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td></td>
<td>By clicking on 'Register' below, you are agreeing to the Terms of Service of the Program as well as the Privacy Policy.
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="50%" align="right">
<input name="reg_page" value="true" type="hidden">
<input name="Reset" value="Reset" type="reset">
</td>
<td align="left">
<input name="submit" value="Register" type="submit" onclick="butCheckForm_onclick();">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
</form></body>
</html>