Professional Documents
Culture Documents
Log in
Log in
Log in
<head>
<title>JSP Page</title>
<script>
function loginValidation()
{
var theForm=window.document.forms[0];
var uName=theForm.userName.value;
var pWord=theForm.password.value;
var uType=theForm.userType.value;
if(uName=="")
{
alert("Please enter username!");
theForm.userName.focus();
return false;
}
if(pWord=="")
{
alert("Please enter password");
theForm.password.focus();
return false;
}
if(uType=="S")
{
alert("Please select the right criteria");
theForm.userType.focus();
return false;
}
if((uName=="admin" && pWord=="admin" && uType=="1")
|| (uName=="dataentry" && pWord=="dataentry" && uType=="2")
{
}
else
{
alert("invalid user");
uName="";
pWord="";
uType="S";
theForm.userName.focus();
return false;
}
}
</script>
</head>
<body>
<html:form action="/logon" onsubmit="return loginValidation();">
<tr>
<td align="right" colspan="2" nowrap>User Type:</td>
<td align="left" class="bodyTextVal" nowrap><html:select
property="userType">
<option value="S"> --Select-- </option>
<option value="1">admin</option>
<option value="2">User</option>
</html:select> </td>
</tr>