?
Solved

Reshreshing a page

Posted on 2005-04-08
10
Medium Priority
?
234 Views
Last Modified: 2006-11-18
Hi there...

I am new not sure if this can be done, i am sure it can.  Here is my problem I have a timesheet that user is going to be entering in data and some is autopopulated(not working on yet).  

This is what I want to do......
form looks like a timesheet form with several rows and columns on it, i am trying to get my text box for total regular hours to work it adds the numbers up but i have to hit the enter button and I don't want to.  I have the total going to a text box called totalRegHours, cause I will need to used it later for total regualur hours worked.   What I want it to do is refresh page(i think) everytime user enters new hours for new day.  So when the user enters 8 hrs for monday that shows up in the TotalReghrs txt box and than when user enters time on Tues it adds on to the hrs already there, like a onclick or onchange event.  
This is the way the client wants it to look!  

I also when i try refresh page in internet explore( it gives error of This page cannot be refreshed without resending the information.  Click retry to resend the information again or click cancel to return to the page that you were trying to view

timsheet looks like this
                                                 Sun                 Mon           Tues           Wed           Thurs.....so on
Date Worked
Time In
Time Out
Total Regular Hours
Total Hours Shift Prem
.....and so on

Grand total boxes at bottom

Here is my code so far

<%@ Language=VBScript %>
<% Option Explicit %>


<%

Sub OnSunEntry()

      Dim total_reg_hrs
        total_reg_hrs = 0
      
      total_reg_hrs= int(request.Form("txt_HoursDay1"))
      response.write total_reg_Hrs
      
End Sub
        
      

 
 
  response.expires = 0
  Dim objConn : set objConn = Server.CreateObject("ADODB.Connection")
  Dim current_datetime : current_datetime = formatdatetime(date(), 1)
  Dim usersrch : usersrch = request.form("cs_empid")
  objConn.ConnectionString= "DSN=timesheet.dsn"
  objConn.Open

  Dim sSQLPayPeriodStart
  Dim sSQLID
  Dim sSQLOtPayrate
  Dim sSQLAbsentCode
  Dim sSQLPosition
  Dim sSQLSchool
  Dim sSQLReasonOvertime  
  Dim rs
  Dim txt_HoursDay1,txt_HoursDay2,txt_HoursDay3,txt_HoursDay4,txt_HoursDay5,txt_HoursDay6,txt_HoursDay7
  Dim txt_ShiftPremDay1,txt_ShiftPremDay2,txt_ShiftPremDay3,txt_ShiftPremDay4,txt_ShiftPremDay5,txt_ShiftPremDay6,txt_ShiftPremDay7
  Dim total_reg_hrs

 

sSQLID = "SELECT Q.ID AS OptValue, " & _
           " Q.ID & ', ' & Q.First_Name & ' ' & Q.Last_Name & ', ' " & _
           " & Q.Position & ', ' & Q.School AS DisplayValue " & _
           " FROM [Employee Info Query]Q"

 
  sSQLPayPeriodStart = "SELECT DISTINCT PayPeriodStart FROM [pay periods] ORDER BY PayPeriodStart"

  sSQLOtPayrate= "SELECT Payrate.Payrate, Payrate.Description FROM Payrate"
 
 
  sSQLAbsentCode = "SELECT [Abscent Code].[Abscent Code] AS AbsCode, [Abscent Code].Description AS Descrip FROM [Abscent Code]"

  sSQLPosition = "SELECT Position.Position AS Pos FROM [Position]"

  sSQLSchool = "SELECT [School Info].ID, [School Info].[School Name]As SchoolNam FROM [School Info]"

  sSQLReasonOvertime = "SELECT tblReasonforOvertime.[Reason For Overtime] AS ReasonOT FROM tblReasonforOvertime"

 

%>


<html>

<head>
<title>SigninTimesheet</title>
<base target="_top">
</head>
<body>
<H1><FONT style=FONT-SIZE:30pt Face="Times New Roman" Color=#000080><B>Employee Weekly Timesheet</FONT></B></H1>

<form name='Signintimesheet' method='post' action='signintimesheet.asp'>

<table border="0" cellpadding="0" cellspacing="0" align=center>
    <tr>
           <td ALIGN=left height="25"><font size=-1 color="#000000">TIMEPERIOD:</font>&nbsp;
 
<%

''call for drop down box


call writeDrop(sSQLPayPeriodStart, _
              "ddPayPeriodStart", _
              "PayPeriodStart", _
              "PayPeriodStart", _
              request("ddPayPeriodStart"), _
              "", _
              true, _
             objConn)
%>
</td></tr>

<tr>
      <td ALIGN=left height="21"><font size=-1 color="#000000">EMPLOYEE ID:</font>&nbsp;
         
<%

call writeDrop(sSQLID, _
              "ddID", _
              "OptValue", _
              "DisplayValue", _
              request("ddID"), _
              "", _
              true, _
              objConn)

%>
       
</td></tr>
           
</table>
     
<BR>
<BR>
<br>
<br>
<br>

<table width="1754" border=1 cellpadding=0 cellspacing=0 >
  <tr height=18 >
    <th width=708  align=LEFT ><br></th>
    <th width="144" align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Sun</font></i></b></th>
    <th width="144" align=LEFT ><b><i><font style=FONT-SIZE:11pt face="Times New Roman" color=#000080>Mon</font></i></b></th>
    <th width="144" align=LEFT ><b><i><font style=FONT-SIZE:11pt face="Times New Roman" color=#000080>Tues</font></i></b></th>
    <th width="144" align=RIGHT ><b><i><font style=FONT-SIZE:11pt face="Times New Roman" color=#000080>Wed</font></i></b></th>
    <th width="144" align=RIGHT ><b><i><font style=FONT-SIZE:11pt face="Times New Roman" color=#000080>Thurs</font></i></b></th>
    <th width="144" align=RIGHT ><b><i><font style=FONT-SIZE:11pt face="Times New Roman" color=#000080>Friday</font></i></b></th>
    <th width="144" align=RIGHT ><b><i><font style=FONT-SIZE:11pt face="Times New Roman" color=#000080>Saturday</font></i></b></th>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Date Worked</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>TimeIn</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Timeout</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Total Regular Hours</font></i></b></th>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay1" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay2" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay3" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay4" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay5" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay6" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay7" ></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Total Hours Shift Premium</font></i></b></th>
    <td width="144"><input name="txt_ShiftPremDay1" type = 'text'></td>
    <td width="144"><input name="txt_ShiftPremDay2" type = 'text'></td>
    <td width="144"><input name="txt_ShiftPremDay3" type = 'text'></td>
    <td width="144"><input name="txt_ShiftPremDay4" type = 'text'></td>
    <td width="144"><input name="txt_ShiftPremDay5" type = 'text'></td>
    <td width="144"><input name="txt_ShiftPremDay6" type = 'text'></td>
    <td width="144"><input name="txt_ShiftPremDay7" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Total Overtime Hours</font></i></b></th>
    <td width="144"><input name="txt_TotOTDay1" type = 'text'></td>
    <td width="144"><input name="txt_TotOTDay2" type = 'text'></td>
    <td width="144"><input name="txt_TotOTDay3" type = 'text'></td>
    <td width="144"><input name="txt_TotOTDay4" type = 'text'></td>
    <td width="144"><input name="txt_TotOTDay5" type = 'text'></td>
    <td width="144"><input name="txt_TotOTDay6" type = 'text'></td>
    <td width="144"><input name="txt_TotOTDay7" type = 'text'></td>
  </tr>
 
  <tr>
    <td  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>OT Payrate</font></i></b></td>
    <td width="144">
<% call writeDrop(sSQLOTPayrate,"dddescription","description","description",request("dddescription"),"",true,objConn)%></td>
    <td width="144"><%
call writeDrop(sSQLOTPayrate, _
              "dddescription", _
              "description", _
              "description", _
              request("dddescription"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144">
      <%
''call for drop down box


call writeDrop(sSQLOTPayrate, _
              "dddescription", _
              "description", _
              "description", _
              request("dddescription"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144">
      <%
''call for drop down box


call writeDrop(sSQLOTPayrate, _
              "dddescription", _
              "description", _
              "description", _
              request("dddescription"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLOTPayrate, _
              "dddescription", _
              "description", _
              "description", _
              request("dddescription"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLOTPayrate, _
              "dddescription", _
              "description", _
              "description", _
              request("dddescription"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144">
      <%
''call for drop down box


call writeDrop(sSQLOTPayrate, _
              "dddescription", _
              "description", _
              "description", _
              request("dddescription"), _
              "", _
              true, _
             objConn)
%></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Pay Overtime</font></i></b></th>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
    <td width="144"><input name="text" type = 'checkbox' value = 'yes'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Hours Absent with Pay</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Hours Absent without Pay</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Lieu Time Used</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Absent Code</font></i></b></th>
    <td width="144">
      <%
''call for drop down box


call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
call writeDrop(sSQLAbsentCode, _
              "ddAbsentCode", _
              "AbsCode", _
              "AbsCode", _
              request("ddAbsentcode"), _
              "", _
              true, _
             objConn)
%></td>

  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Position</font></i></b></th>
    <td width="144">
      <%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%>
    </td>
    <td width="144"><%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%>
    </td>
    <td width="144"><%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%>
    </td>
    <td width="144"><%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%>
    </td>
    <td width="144">
      <%  
''call for drop down box


call writeDrop(sSQLPosition, _
              "ddPosition", _
              "Pos", _
              "Pos", _
              request("ddPosition"), _
              "", _
              true, _
             objConn)
%></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>School</font></i></b></th>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)


%></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Second Location</font></i></b></th>
    <td width="144"><%

''call for drop down box

call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLSchool, _
              "ddSchool", _
              "SchoolNam", _
              "SchoolNam", _
              request("ddSchool"), _
              "", _
              true, _
             objConn)
%></td>

  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Reason For Overtime</font></i></b></th>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
    <td width="144"><%
''call for drop down box


call writeDrop(sSQLReasonOvertime, _
              "ddReasonOvertime", _
              "ReasonOT", _
              "ReasonOT", _
              request("ddReasonOvertime"), _
              "", _
              true, _
             objConn)

%></td>
  </tr>
  <tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Comments</font></i></b></th>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
    <td width="144"><input name="text" type = 'text'></td>
  </tr>
</table>
<BR>
<BR>
<BR>



<input type="text" name="TotalRegHours">
<% call OnSunEntry%>

<input type="hidden" name="TotalShift">
<% Dim TotalShift
      TotalShift=txt_ShiftPremDay1 + txt_ShiftPremDay2 + txt_ShiftPremDay3+ txt_ShiftPremDay4+ txt_ShiftPremDay5+ txt_ShiftPremDay6+ txt_ShiftPremDay7
      
%>

<input type="hidden" name="SumOvertime">
<% Dim SumOvertime
      SumOvertime=+([sumovertime])
%>

      
<TABLE>
     <TR>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>TOTAL REGULAR HOURS WORKED</FONT></B></I></td>
          <td><input type = 'text'>
      <tr>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>OVERTIME HOURS TO BE PAID</FONT></B></I></td>
          <td><input type = 'text'></td>
     </TR>
     </TR>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>TOTAL HOURS SHIFT PREMIUM</FONT></B></I></td>
          <td><input type = 'text'></td>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>OVERTIME HOURS TO BE SAVED</FONT></B></I></td>
          <td><input type = 'text'></td>
     </TR>
     <TR>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>TOTAL OVERTIME HOURS</FONT></B></I></td>
          <td><input type = 'text'></td>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>LIEU TIME HOURS SAVED THIS PAY</FONT></B></I></td>
          <td><input type = 'text'></td>
     </TR>
     <TR>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>TOTAL OVERTIME HOURS @ TIME AND A HALF</FONT></B></I></td>
          <td><input type = 'text'></td>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>PAY COMMENTS</FONT></B></I></td>
          <td><input type = 'text'></td>
     </TR>
     <TR>
          <td  WIDTH=0 ALIGN=LEFT ><B><I><FONT style=FONT-SIZE:12pt FACE="Times New Roman" COLOR=#000080>TOTAL OVERTIME HOURS @ DOUBLE</FONT></B></I></td>
          <td><input type = 'text'></td>
     </TR>
</TABLE>
<br>
<br>
<table>
<table border="0" cellpadding="0" cellspacing="0" align=center>
      <tr>
            <td ALIGN=CENTER VALIGN=BOTTOM COLSPAN="2">
                 <input type='submit' value='Correct Date'>
            
</td>
      
      <td ALIGN=CENTER VALIGN=BOTTOM COLSPAN="2">
             <input type='submit' value='Next Employee Timesheet'></td>
      
      <td ALIGN=CENTER VALIGN=BOTTOM COLSPAN="2">
             <input type='submit' value='Menu'></td>
      
      <td ALIGN=CENTER VALIGN=BOTTOM COLSPAN="2">
             <input type='submit' value='ViewTimesheet'></td>
      
      <td ALIGN=CENTER VALIGN=BOTTOM COLSPAN="2">
             <input type='submit' value='Save Overtime'></td>
      </tr>
</table>
   
</form>  
</body>
</html>

<%

objConn.close
set objConn = nothing

'routine for drop down box
Sub writeDrop(sSQL, _
              sSelectName, _
              sDBFieldNameForOptVal, _
              sDBFieldNameForOptDisp, _
              sSelectedValue, _
              sOtherSelectAtts, _
              bWriteBlankOption, _
              activeConnection)


  Dim sOnChange, sFieldForCompare
  Set rs = server.createobject("ADODB.RecordSet")
  rs.open sSQL, activeConnection, 1, 3, 1
  sOnChange = ""



%>
      <SELECT name="<%=sSelectName%>" id="<%=sSelectName%>" <%=sOtherSelectAtts%> <%=sOnChange%>>
<%
      if bWriteBlankOption=true then
%>
        <option value="0"></option>
<%              
      end if
      if isnumeric(sSelectedValue) then
        sSelectedValue = cint(sSelectedValue)
      end if
      do while not rs.eof
        if isNumeric(rs(sDBFieldNameForOptVal)) then
          sFieldForCompare = cint(rs(sDBFieldNameForOptVal))
        else
          sFieldForCompare = cstr(rs(sDBFieldNameForOptVal))
        end if
%>              
        <option <%if (sSelectedValue=sFieldForCompare) then%> selected <%end if%> value="<%=rs(sDBFieldNameForOptVal)%>"><%=rs(sDBFieldNameForOptDisp)%></option>
<%
        rs.movenext
      loop
%>              
      </SELECT>
</td>
<%
End Sub


%>


Here is my code so far
0
Comment
Question by:neicy62
  • 4
  • 3
  • 3
10 Comments
 
LVL 10

Expert Comment

by:lengreen
ID: 13735821
Hi neicy62,

any time you need to update the form onclick etc, just call this function, all changes will be posted back & the page should repopulate

<script language=javascript>
function refreshform(){
document.forms['Signintimesheet'].submit();
}
</script>


Cheers!
0
 

Author Comment

by:neicy62
ID: 13735878
Hey lengreen....

I will try and let you know how I make out.  Does it matter that I am using vbscript, I know I should have used javascript but had already started project with vbscript.


Denise
0
 
LVL 10

Expert Comment

by:lengreen
ID: 13735951
thats a client side function so needs to go within the head tag of your html

cheers
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:neicy62
ID: 13736080
Hey lengreen...

where and how do i put my onchange in each one of these textboxes...each textbox represents a day of the week

<tr>
    <th  width=708 align=LEFT ><b><i><font style=FONT-SIZE:12pt face="Times New Roman" color=#000080>Total Regular Hours</font></i></b></th>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay1" onchange = ???????? HOW DO I DO THIS></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay2" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay3" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay4" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay5" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay6" ></td>
    <td width="144"><input type = "TEXT" name = "txt_HoursDay7" ></td>
  </tr>
0
 
LVL 10

Accepted Solution

by:
lengreen earned 2000 total points
ID: 13736180
i would use onblur, that way when they leave the textbox the page will be submitted

onblur = "refreshform()"
0
 
LVL 18

Expert Comment

by:SquareHead
ID: 13736551
@neicy62 --

Rather than submitting the form to do the addition, take a look at your previous question:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21378392.html

Take the javascript function provided by justbillig and use it in your page, calling it on the onchange event for your textfields...

so, it'd look something like this:

<html>
<head>
      <title>Untitled</title>
<script language="javascript">

function Add( )
{
     // Get the values from the three different text boxes
     var sngValue1 = parseFloat( frmMain.txtTextBox1.value );
     var sngValue2 = parseFloat( frmMain.txtTextBox2.value );
     var sngValue3 = parseFloat(frmMain.txtTextBox3.value );

     // Add them all together and put them in the total box
     frmMain.txtTotal.value = ( sngValue1 + sngValue2 + sngValue3 );
}
</script>

</head>

<body>
          <form name="frmMain">
               <input type="text" name="txtTextBox1" onblur="Add();" value="0">
               <input type="text" name="txtTextBox2" onblur="Add();" value="0">
               <input type="text" name="txtTextBox3" onblur="Add();" value="0">
         
               <br>
               <input type="text" name="txtTotal">
               <input type="button" value="Add" onclick="Add( );">
          </form>
</body>
</html>
0
 
LVL 10

Expert Comment

by:lengreen
ID: 13736809
neicy62,

agree with squarehead, but if you need to save the data to a database you will need to do a submit at some point

cheers

Len
0
 

Author Comment

by:neicy62
ID: 13737088
Hey there....

I am going to need to do a submit but at the end, it crazy but there are 17 text boxes down the side and the days of the week accross the top that they will be filing out various things.  The form looks like this

Some of these are text boxes the user fills in some of this are check boxes and drop downboxes that they pick stuff from and some are going to be autopopulated like the date worked.   The timesheet covers a one week period.

timsheet looks like this
                                                 Sun                 Mon           Tues           Wed           Thurs       Fri          Sat
Date Worked
Time In
Time Out
Total Regular Hours
Total Hours Shift Prem
Total Overtime Hours
OT Payrate
Pay Overtime
Hours Absent with Pay
Hours Absent without Pay
Lieu Time Used
Absent Code
Position
School
Second location
Reason for Overtime
Comments

Wtih grand total text boxes under here as well as some buttons submit, next employee timesheet.........


Hope this helps you to understand what I am trying to do not a easy task!

Denise:)




0
 
LVL 18

Expert Comment

by:SquareHead
ID: 13737157
Yeah, looks like a lot of work. But it shouldn't be too complicated using client-side scripts to sum certain fields, etc.

Looking at this, I would recommend a separate ADD function for each day, then another ADD function that sums the day's totals into a grand total.
0
 
LVL 18

Expert Comment

by:SquareHead
ID: 13737169
And of course, a final submit when you're ready to record your values in the DB or pass them to another page, etc...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question