-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddDriver.jsp
163 lines (160 loc) · 5.29 KB
/
addDriver.jsp
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
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<form id="form1" name="form1" method="post" action="do?MOD=MTN&ACT=AddDriver" >
<table width="80%" border="0" align="center">
<tr>
<th colspan="5" scope="col"><div class="header">
<div align="left">Add Driver Details </div>
</div></th>
</tr>
<tr>
<td width="15%"> </td>
<td width="23%"> </td>
<td width="3%"> </td>
<td width="38%"> </td>
<td width="21%"> </td>
</tr>
<tr>
<td> </td>
<td>Driver First Name </td>
<td>:</td>
<td><label>
<input name="FirstName" type="text" id="FirstName" size="30" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Driver Last Name </td>
<td>:</td>
<td><label>
<input name="LastName" type="text" id="LastName" size="30" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Address</td>
<td>:</td>
<td><label>
<input name="Address" type="text" id="Address" size="40" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>City </td>
<td>:</td>
<td><label>
<input name="City" type="text" id="City" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>State. </td>
<td>:</td>
<td><label>
<input name="State" type="text" id="State" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Mobile No. </td>
<td>:</td>
<td><label>
<input name="MobileNo" type="text" id="MobileNo" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>License No. </td>
<td>:</td>
<td><label>
<input name="LicenseNo" type="text" id="LicenseNo" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Expiry Date </td>
<td>:</td>
<td><label>
<input type="text" name="doe" readonly="true"/>
<a href="javascript: void(0);" onMouseOver="if (timeoutId) clearTimeout(timeoutId);window.status='Show Calendar';return true;" onMouseOut="if (timeoutDelay) calendarTimeout();window.status='';" onClick="g_Calendar.show(event,'form1.doe',true,'yyyy-mm-dd'); return false;"><img src="include/calendar.gif" name="imgCalendar" width="34" height="21" border="0" alt="" ></a></label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Year of Experiacne </td>
<td>:</td>
<td><label>
<input type="text" name="Experiance" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Note</td>
<td>:</td>
<td><label>
<textarea name="Note" cols="30" rows="5" id="Note"></textarea>
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>
<div align="right">
<input type="reset" name="Submit2" value="Reset" class="redButton"/>
</div>
</label></td>
<td> </td>
<td><label>
<input name="Submit" type="submit" class="redButton" onclick="MM_validateForm('FirstName','','R','LastName','','R','Address','','R','City','','R','State','','R','MobileNo','','R','LicenseNo','','R','Experiance','','RisNum');return document.MM_returnValue" value="Add Driver" />
</label></td>
<td> </td>
</tr>
</table>
</form>
<hr width="600px" style="background:#D22929; border:#D22929 solid 2px;"/>