M
ms.jennylim
hi,
i am new to jsp programming, and is stuck with the following situation.
i got an employee form with fields like emp no., username, etc. the
value entered in emp no. is supposed to be reflected in username upon
going to the next field. also, i am trying to grey out the field to
certain role of user. any suggestion abt the syntax?
my current syntax is :-
<form name="insertForm" method="POST" action="updateStaffDetails.jsp"
onSubmit="return validateEntries(document.insertForm)">
<table border="0" cellpadding="2" cellspacing="0" width="710">
<tr>
<td width="147" align="left">Staff ID *</td>
<td width="551" align="left"><!--webbot bot="Validation"
S-Display-Name="EmployeeID" S-Data-Type="Integer"
S-Number-Separators=","
B-Value-Required="TRUE" I-Maximum-Length="8" --><input
type="text" name="empNo" size="10" maxlength="8">
</td>
</tr>
<tr>
<td width="147" align="left">Staff Name *</td>
<td align="left" width="551"><!--webbot bot="Validation"
B-Value-Required="TRUE" I-Maximum-Length="30" --><input
type="text" name="empName" size="30" maxlength="30" > </td>
</tr>
<tr>
<td width="147" align="left">Company *</td>
<td width="551" align="left">
<select name="coCode" size="1"
onChange="addDivisionOptions(document.insertForm, ' ');
addDepartmentOptions(document.insertForm, ' ')">
<%
i = 0;
while (coCodeList != null) {
if (coCodeList.equals(coCode)) {
%>
<option value=<%= coCodeList %> selected><%= coCodeList
%> <%= coNameList[i++] %>
<%
}
else {
%>
<option value=<%= coCodeList %>><%= coCodeList
%> <%= coNameList[i++] %>
<%
}
}
%>
</select>
</td>
</tr>
<tr>
<td width="147" align="left">Division *</td>
<td width="551" align="left">
<select name="divCode" size="1"
onChange="addDepartmentOptions(document.insertForm, ' ')"></select>
</td>
<tr>
<td width="147" align="left">Department *</td>
<td width="551" align="left">
<select name="deptCode" size="1"></select>
</td>
<tr>
<td width="147" align="left">Role *</td>
<td width="551" align="left">
<select name="role" size="1">
<option value="STAFF" selected>Staff
</select>
</td>
</tr>
<tr>
<td width="147" align="left">Executive Flag *</td>
<td width="551" align="left">
<select name="executiveFlag" size="1">
<option value="Y" selected>Yes
<option value="N">No
</select>
</td>
</tr>
<tr>
<td width="147" align="left">User Name </td>
<td width="551" align="left">
<!--webbot bot="Validation" B-Value-Required="TRUE"
I-Minimum-Length="5"
I-Maximum-Length="10" -->
<input type="text" name="userName" size="10" maxlength="10">
</td>
</tr>
<tr>
<td width="147" align="left">InActive Date</td>
<td width="551" align="left"><!--webbot bot="Validation"
B-Value-Required="TRUE" I-Maximum-Length="10" --><input
type="text" name="inactiveDate" size="10" maxlength="10">
<a href="javascript:showCalendar('document.insertForm.inactiveDate',
document.insertForm.inactiveDate.value, true);">
<img src="images/bt_calendar.gif" heigh=21 border=0 align=top></a>
</td>
</tr>
</table>
<p><input type="submit" value="Save" name="Save">
<input type="hidden" value="I" name="operationFlag">
<input type="button" value="Refresh" onclick="location.reload()">
</form>
i tried inserting value="<%= empNo %>" at the username but
unsuccessful. pls help.
thanks.
i am new to jsp programming, and is stuck with the following situation.
i got an employee form with fields like emp no., username, etc. the
value entered in emp no. is supposed to be reflected in username upon
going to the next field. also, i am trying to grey out the field to
certain role of user. any suggestion abt the syntax?
my current syntax is :-
<form name="insertForm" method="POST" action="updateStaffDetails.jsp"
onSubmit="return validateEntries(document.insertForm)">
<table border="0" cellpadding="2" cellspacing="0" width="710">
<tr>
<td width="147" align="left">Staff ID *</td>
<td width="551" align="left"><!--webbot bot="Validation"
S-Display-Name="EmployeeID" S-Data-Type="Integer"
S-Number-Separators=","
B-Value-Required="TRUE" I-Maximum-Length="8" --><input
type="text" name="empNo" size="10" maxlength="8">
</td>
</tr>
<tr>
<td width="147" align="left">Staff Name *</td>
<td align="left" width="551"><!--webbot bot="Validation"
B-Value-Required="TRUE" I-Maximum-Length="30" --><input
type="text" name="empName" size="30" maxlength="30" > </td>
</tr>
<tr>
<td width="147" align="left">Company *</td>
<td width="551" align="left">
<select name="coCode" size="1"
onChange="addDivisionOptions(document.insertForm, ' ');
addDepartmentOptions(document.insertForm, ' ')">
<%
i = 0;
while (coCodeList != null) {
if (coCodeList.equals(coCode)) {
%>
<option value=<%= coCodeList %> selected><%= coCodeList
%> <%= coNameList[i++] %>
<%
}
else {
%>
<option value=<%= coCodeList %>><%= coCodeList
%> <%= coNameList[i++] %>
<%
}
}
%>
</select>
</td>
</tr>
<tr>
<td width="147" align="left">Division *</td>
<td width="551" align="left">
<select name="divCode" size="1"
onChange="addDepartmentOptions(document.insertForm, ' ')"></select>
</td>
<tr>
<td width="147" align="left">Department *</td>
<td width="551" align="left">
<select name="deptCode" size="1"></select>
</td>
<tr>
<td width="147" align="left">Role *</td>
<td width="551" align="left">
<select name="role" size="1">
<option value="STAFF" selected>Staff
</select>
</td>
</tr>
<tr>
<td width="147" align="left">Executive Flag *</td>
<td width="551" align="left">
<select name="executiveFlag" size="1">
<option value="Y" selected>Yes
<option value="N">No
</select>
</td>
</tr>
<tr>
<td width="147" align="left">User Name </td>
<td width="551" align="left">
<!--webbot bot="Validation" B-Value-Required="TRUE"
I-Minimum-Length="5"
I-Maximum-Length="10" -->
<input type="text" name="userName" size="10" maxlength="10">
</td>
</tr>
<tr>
<td width="147" align="left">InActive Date</td>
<td width="551" align="left"><!--webbot bot="Validation"
B-Value-Required="TRUE" I-Maximum-Length="10" --><input
type="text" name="inactiveDate" size="10" maxlength="10">
<a href="javascript:showCalendar('document.insertForm.inactiveDate',
document.insertForm.inactiveDate.value, true);">
<img src="images/bt_calendar.gif" heigh=21 border=0 align=top></a>
</td>
</tr>
</table>
<p><input type="submit" value="Save" name="Save">
<input type="hidden" value="I" name="operationFlag">
<input type="button" value="Refresh" onclick="location.reload()">
</form>
i tried inserting value="<%= empNo %>" at the username but
unsuccessful. pls help.
thanks.