I continue to get a syntax Error where my VBScript portion of this html document is. It seems to me that it is telling me that <% %> is not correct. Also It is telling me that an object is expected on the line where <b>Staff Person Verified<b> is written. Here is my code:
Code:
<html>
<head>
<Title>Electronic Employee Timesheet -- Test Health Systems</Title>
<SCRIPT LANGUAGE="JavaScript">
//This function will collect the username & password of a staff person and authenicate them against Active Directory.
<%
Dim userNam, auth, strGroups
set oSysInfo = CreateObject("ADSystemInfo")
userNam = oSysInfo.username
Set CurrentUser = GetObject("LDAP://" & userNam)
strGroups = LCase(Join(CurrentUser.MemberOf))
Const group = "cn=SR-Network_Team,OU=SR,DC=test,DC=net"
IF InStr(1,strGroups, group,1) > 0 THEN
auth = 1
END IF
IF InStr(1,strGroups, group,1) < 0 THEN
auth = 0
END IF
%>
function fnAut(){
var passWd,userNam, auth
passWd=prompt("User please enter your Test password:","");
<%=auth%>=auth;
If (auth == 1){
document.form.StaffVerbx.checked.value=true;}
else {alert("Your account could not be verified!");
}
)
</SCRIPT>
</head>
<body background="E:\My Documents\Downloads\Images\chsbackground.gif"></br>
<h1><big><center>Test Health System TimeSheet</center></big></h1></br></br>
<form action="mailto:rhinton@test.org" method="post" name="form">
<P>
<b>Staff Full Name</b> <Input type="text" name="staffNam"></br>
<b>Staff Username</b> <Input type="text" name="userNam"></br>
<b>Staff Social Security Number</b> <Input type="text" name="socialSec"></br></br>
<table border="1">
<tr><th colspan="2">Week of: <Input type="text" name="payweek1"><th>Time In<th>Time Out<th>Other (On Call, Sick,</br>Vacation, Personal, Travel,</br>Lunch)<th>Total Hours
<tr><th colspan="2">Monday<td><Input type="text" name="monIn1"><td><Input type="text" name="monOut1"><td><Input type="text" name="monOth1"><td><Input type="text" name="monTot1">
<tr><th colspan="2">Tuesday<td><Input type="text" name="tueIn1"><td><Input type="text" name="tueOut1"><td><Input type="text" name="tueOth1"><td><Input type="text" name="tueTot1">
<tr><th colspan="2">Wednesday<td><Input type="text" name="wedIn1"><td><Input type="text" name="wedOut1"><td><Input type="text" name="wedOth1"><td><Input type="text" name="wedTot1">
<tr><th colspan="2">Thursday<td><Input type="text" name="thuIn1"><td><Input type="text" name="thuOut1"><td><Input type="text" name="thuOth1"><td><Input type="text" name="thuTot1">
<tr><th colspan="2">Friday<td><Input type="text" name="friIn1"><td><Input type="text" name="friOut1"><td><Input type="text" name="friOth1"><td><Input type="text" name="friTot1">
<tr><th colspan="2">Saturday<td><Input type="text" name="satIn1"><td><Input type="text" name="satOut1"><td><Input type="text" name="satOth1"><td><Input type="text" name="satTot1">
<tr><th colspan="2">Sunday<td><Input type="text" name="sunIn1"><td><Input type="text" name="sunOut1"><td><Input type="text" name="sunOth1"><td><Input type="text" name="sunTot1">
<tr><th colspan="5" align="right"><Input type="button" name="calBtn1" value="Calculate Total Hours" onClick=> Total Hours For The Week<td><Input type="text" name="totHrs1">
</table></br></br>
<table border="1">
<tr><th colspan="2">Week of: <Input type="text" name="payweek2"><th>Time In<th>Time Out<th>Other (On Call, Sick,</br>Vacation, Personal, Travel,</br>Lunch)<th>Total Hours
<tr><th colspan="2">Monday<td><Input type="text" name="monIn2"><td><Input type="text" name="monOut2"><td><Input type="text" name="monOth2"><td><Input type="text" name="monTot2">
<tr><th colspan="2">Tuesday<td><Input type="text" name="tueIn2"><td><Input type="text" name="tueOut2"><td><Input type="text" name="tueOth2"><td><Input type="text" name="tueTot2">
<tr><th colspan="2">Wednesday<td><Input type="text" name="wedIn2"><td><Input type="text" name="wedOut2"><td><Input type="text" name="wedOth2"><td><Input type="text" name="wedTot2">
<tr><th colspan="2">Thursday<td><Input type="text" name="thuIn2"><td><Input type="text" name="thuOut2"><td><Input type="text" name="thuOth2"><td><Input type="text" name="thuTot2">
<tr><th colspan="2">Friday<td><Input type="text" name="friIn2"><td><Input type="text" name="friOut2"><td><Input type="text" name="friOth2"><td><Input type="text" name="friTot2">
<tr><th colspan="2">Saturday<td><Input type="text" name="satIn2"><td><Input type="text" name="satOut2"><td><Input type="text" name="satOth2"><td><Input type="text" name="satTot2">
<tr><th colspan="2">Sunday<td><Input type="text" name="sunIn2"><td><Input type="text" name="sunOut2"><td><Input type="text" name="sunOth2"><td><Input type="text" name="sunTot2">
<tr><th colspan="5" align="right"><Input type="button" name="calBtn2" value="Calculate Total Hours"> Total Hours For The Week<td><Input type="text" name="totHrs2">
</table></br>
</br>
<b>Staff Person Verified</b><Input type="checkbox" name="staffVerbx"><Input type="button" name="staffVal" value="Validate Staff Person" onclick="JfnAut()"></br>
<b>Supervisor Full Name</b> <Input type="text" name="superNam"></br>
<b>Supervisor Verified</b> <Input type="checkbox" name="superVerbx"> <Input type="button" name="superVal" value="Validate Supervisor" align="right" onclick="JavaScript:fnAut;"></br></br>
<Input type="Submit" name="subBtn" value="Submit">
<Input type="Reset" name="resetBtn" value="Reset">
</P>
</form>
</body>
</html>