Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Show a running total


Message #1 by "Dave Parkins" <dave.parkins@m...> on Wed, 7 Aug 2002 19:43:57
Phil, it may be because I have other text boxes on the form besides the 
ones I want to calculate.  I have sent you the whole code. What the form 
does is bring in data to create an invoice. Once the form is submitted, 
the information is saved through an array so a person can create another 
invoice based on the same data.  I have coded a sum but it doesn't work 
until after the form is submitted which is why I wanted to create one 
that does it on the fly. Again, I really appreciate your help. Most of 
this form was created using macromedia ultradev.

Dave



<%@LANGUAGE="VBSCRIPT"%>
<% 
Set asplObj=Server.CreateObject("PL.Login")
asplObj.group("test")
		         asplObj.Protect
                Session("UserID") = Session("asplUserName")
                Set asplObj=Nothing
%>
<% Response.Buffer = TRUE %>

<%If IsArray(Session("SavedArray")) Then
LocalArray = Session("SavedArray")
  assess_1_text = LocalArray(0, 0)
  assessment_1 = LocalArray(0, 1)
  assess_2_text = LocalArray(1, 0)
  assessment_2 = LocalArray(1, 1)
  assess_3_text = LocalArray(2, 0)
  assessment_3 = LocalArray(2, 1)
  assess_4_text = LocalArray(3, 0)
  assessment_4 = LocalArray(3, 1)
  assess_5_text = LocalArray(4, 0)
  assessment_5 = LocalArray(4, 1)
  assess_6_text = LocalArray(5, 0)
  assessment_6 = LocalArray(5, 1)
'ELSE 
'response.write "your previous answers do not exist<BR>"
END IF %>


<!--#include file="Connections/test.asp" -->
<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) <> "") Then

  MM_editConnection = MM_test_STRING
  MM_editTable = "dbo.ManInvoice"
  MM_editRedirectUrl = "detail.asp?update=1" & "&app=" & Request("App") 
& "&lse=" & Request("lse") & "&location=" & request("location")
  MM_fieldsStr  
= "lse_s|value|app_s|value|Bill_nam_s|value|les_s|value|bill_add_s|value|I
nvoice_date|value|bill_add2_s|value|nam_long_s|value|bill_cty_s|value|bill
_st_s|value|bill_zip_s|value|lease_description|value|Payment_due_date|valu
e|description_on_return|value|assess_1_text|value|assessment_1|value|asses
s_2_text|value|assessment_2|value|assess_3_text|value|assessment_3|value|a
ssess_4_text|value|assessment_4|value|assess_5_text|value|assessment_5|val
ue|assess_6_text|value|assessment_6|value|username|value|show_lse|value"
  MM_columnsStr 
= "lse_s|none,none,NULL|app_s|none,none,NULL|bill_nam_s|',none,''|les_s|',
none,''|bill_add_s|',none,''|Invoice_Date|',none,NULL|bill_add2_s|',none,'
'|nam_long_s|',none,''|bill_cty_s|',none,''|bill_st_s|',none,''|bill_zip_s
|',none,''|Lease_Description|',none,''|Payment_Due_Date|',none,''|Descript
ion_on_Return|',none,''|assess_1_Text|',none,''|Assessment_1|none,none,NUL
L|assess_2_Text|',none,''|Assessment_2|none,none,NULL|assess_3_Text|',none
,''|Assessment_3|none,none,NULL|assess_4_Text|',none,''|Assessment_4|none,
none,NULL|assess_5_Text|',none,''|Assessment_5|none,none,NULL|assess_6_Tex
t|',none,''|Assessment_6|none,none,NULL|username|',none,''|show_lse|none,1
,0"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(i+1) = CStr(Request(MM_fields(i)))
  Next

  ' append the query string to the redirect URL
  'If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
   ' If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And 
Request.QueryString <> "") Then
    '  MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
   'Else
    '  MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    'End If
  'End If

End If
%>

<% ' save the previous assessment values as an array
IF Request("assess_1_text") <> "" THEN
 Dim arrDualArray(5,1)
arrDualArray(0,0) = request("assess_1_text")
arrDualArray(0,1) = request("assessment_1")
arrDualArray(1,0) = request("assess_2_text")
arrDualArray(1,1) = request("assessment_2")
arrDualArray(2,0) = request("assess_3_text")
arrDualArray(2,1) = request("assessment_3")
arrDualArray(3,0) = request("assess_4_text")
arrDualArray(3,1) = request("assessment_4")
arrDualArray(4,0) = request("assess_5_text")
arrDualArray(4,1) = request("assessment_5")
arrDualArray(5,0) = request("assess_6_text")
arrDualArray(5,1) = request("assessment_6")

'For i = LBound(arrDualArray) to UBound(arrDualArray)
' Response.Write arrDualArray(i, 0) & " - "
'  Response.Write arrDualArray(i, 1) & "<BR>"
'Next 

'Storing the array in the Session object
Session("SavedArray") = arrDualArray
 END IF %>

<%
' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request("MM_insert")) <> "") Then

  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    FormVal = MM_fields(i+1)
    MM_typeArray = Split(MM_columns(i+1),",")
    Delim = MM_typeArray(0)
    If (Delim = "none") Then Delim = ""
    AltVal = MM_typeArray(1)
    If (AltVal = "none") Then AltVal = ""
    EmptyVal = MM_typeArray(2)
    If (EmptyVal = "none") Then EmptyVal = ""
    If (FormVal = "") Then
      FormVal = EmptyVal
    Else
      If (AltVal <> "") Then
        FormVal = AltVal
      ElseIf (Delim = "'") Then  ' escape quotes
        FormVal = "'" & Replace(FormVal,"'","''") & "'"
      Else
        FormVal = Delim + FormVal + Delim
      End If
    End If
    If (i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End if
    MM_tableValues = MM_tableValues & MM_columns(i)
    MM_dbValues = MM_dbValues & FormVal
  Next
  'MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues 
& ") values (" & MM_dbValues & ")"

'putting Lease or Residual into their field
	IF request("LeaseType") = "L" THEN 
	response.write "Lease is L <BR>"
  MM_tableValues = MM_tableValues & ", Lease"
  MM_dbValues = MM_dbValues & ", 'L'"
	ELSE
	response.write "Lease is R <BR>"
    MM_tableValues = MM_tableValues & ", Residual"
    MM_dbValues = MM_dbValues & ", 'R'"
	END IF
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") 
values (" & MM_dbValues & ")"

' --- Modified MM Code; Adding other values to the MM_values ---
  'Dim strPrintName
  'strPrintName = Request.Form("FirstName") & " " &
  'Request.Form("MiddleInitial")& " " & Request.Form("LastName")
  'MM_tableValues = MM_tableValues & ", PrintName"
  'MM_dbValues = MM_dbValues & "', '" & strPrintName & "'"
  'MM_insertStr = "insert into " & MM_tableName & " (" & MM_tableValues 
& ") values (" & MM_dbValues & ")"
  ' --- End Modified MM Code ---


  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
%>
<%
set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_test_STRING
Recordset2.Source = "SELECT SUM(ISNULL(Assessment_1, 0)) + SUM(ISNULL
(Assessment_2, 0))+SUM(ISNULL(Assessment_3, 0)) + SUM(ISNULL
(Assessment_4, 0)) +SUM(ISNULL(Assessment_5, 0))  +SUM(ISNULL
(Assessment_6, 0))  AS Expr1  FROM ManInvoice  GROUP BY ID  ORDER BY id 
desc"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open()
Recordset2_numRows = 0
%>
<% Dim Recordset1__lease
Recordset1__lease = "%"
if (request.querystring("lse") <> "") then Recordset1__lease = 
request.querystring("lse")
%>
<% Dim Recordset1__app
Recordset1__app = "%"
if (request.querystring("app") <> "") then Recordset1__app = 
request.querystring("app")
%>
<%' response.write request("location") %>
<% 'booked
SELECT CASE request("location")
case "Booked"
	strSQL = "SELECT TLease.lse_s, TLease.bill_nam_s as 
lse_nam,TLease.bill_add_s as lse_add,TLease.bill_add2_s as lse_add2, 
TLease.bill_cty_s as lse_cty, TLease.bill_st_s as 
lse_st,TLease.bill_zip_s as lse_zip, TLease.desc_s, TLessee.les_s, 
TLessee.nam_long_s, TLessee.bill_nam_s, TLessee.bill_add_s, 
TLessee.bill_add2_s, TLessee.bill_cty_s, TLessee.bill_st_s, 
TLessee.bill_zip_s FROM TLease INNER JOIN TLessee ON TLease.les_s = 
TLessee.les_s WHERE  TLease.lse_s LIKE '%" & Replace(Trim
(Recordset1__lease), "'", "''") & "%' "

'Application
CASE "Application" 
	strSQL = "SELECT TApplication.app_s, TApplication.les_s, 
TLessee.nam_long_s, TApplication.desc_s, TApplication.bill_nam_s as 
lse_nam, TApplication.bill_add_s as lse_add, TApplication.bill_add2_s as 
lse_add2, TApplication.bill_cty_s as lse_cty, TApplication.bill_st_s as 
lse_st, TApplication.bill_zip_s as lse_zip,TLessee.bill_nam_s, 
TLessee.bill_add_s, TLessee.bill_add2_s, TLessee.bill_cty_s, 
TLessee.bill_st_s, TLessee.bill_zip_s FROM TApplication INNER JOIN 
TLessee ON TApplication.les_s = TLessee.les_s WHERE app_s LIKE '%" & 
Replace(Trim(Recordset1__app), "'", "''") & "%'"

CASE ELSE 'if no value passed
	response.write "Please select a value"
	response.end
END SELECT

'response.write strSQL
'response.end %>
<% set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_test_STRING
Recordset1.Source = strSQL
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<html>
<head>
<title>Manual Invoice Update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="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') {
        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 (val<min || max<val) 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>
<script language="javascript">
<!--
function invoice()
	{
          NothingSpecial = Math.round(Math.random() * 1000)
          report.prompt0.value = NothingSpecial
	}	
function invoice1()
	{
          NothingSpecial = Math.round(Math.random() * 1000)
          report1.prompt0.value = NothingSpecial
	}
function CheckLength1()  
 {
 	var str = new String;
 	str = document.update.assess_1_text.value;
 	if(Len(str) > 254)
 	{
 	alert("Please restrict your message to Maximum of 255 
Characters");
 	document.update.assess_1_text.value = Left(str,Len(str)-1);
 	}
 
 }
 function CheckLength2()  
 {
 	var str = new String;
 	str = document.update.assess_2_text.value;
 	if(Len(str) > 254)
 	{
 	alert("Please restrict your message to Maximum of 255 
Characters");
 	document.update.assess_2_text.value = Left(str,Len(str)-1);
 	}
 
 }
 function CheckLength3()  
 {
 	var str = new String;
 	str = document.update.assess_3_text.value;
 	if(Len(str) > 254)
 	{
 	alert("Please restrict your message to Maximum of 255 
Characters");
 	document.update.assess_3_text.value = Left(str,Len(str)-1);
 	}
 
 }
 function CheckLength4()  
 {
 	var str = new String;
 	str = document.update.assess_4_text.value;
 	if(Len(str) > 254)
 	{
 	alert("Please restrict your message to Maximum of 255 
Characters");
 	document.update.assess_4_text.value = Left(str,Len(str)-1);
 	}
 
 }
 function CheckLength5()  
 {
 	var str = new String;
 	str = document.update.assess_5_text.value;
 	if(Len(str) > 254)
 	{
 	alert("Please restrict your message to Maximum of 255 
Characters");
 	document.update.assess_5_text.value = Left(str,Len(str)-1);
 	}
 
 }
 function CheckLength6()  
 {
 	var str = new String;
 	str = document.update.assess_6_text.value;
 	if(Len(str) > 254)
 	{
 	alert("Please restrict your message to Maximum of 255 
Characters");
 	document.update.assess_6_text.value = Left(str,Len(str)-1);
 	}
 
 }
function Left(str, n)

{
        if (n <= 0)     
                return "";
        else if (n > String(str).length)   
                return str;                
        else 
                return String(str).substring(0,n);
}

function Len(str)

{  
return String(str).length;  
}


function calcTotal() {

		 var a = 0;

 		 		 for(i=18; 
i<document.update.elements.length -2; i++) {

		 		 		 if (isNaN 
(document.update.elements[i].value)) 
{ //check to see if number
 		 		 		 		 alert
("Please enter a number")
 		 		 		 		 
document.update.elements[i].value="";
 		 		 		 		 
document.update.elements[i].focus();
		 		 		 		 break;
 		 		 		 }

 		 		 		 if 
(document.update.elements[i].value == "") 
{ //if null

 		 		 		 		 a += 
0; //value of 0 is added to a

 		 		 		 } else { //must be a 
value so add to a

 		 		 		 		 a += 
parseInt(document.update.elements[i].value);
 		 		 		 }

 		 		 }

 		 		 		 
document.update.total.value = a;

 }

function dissallow() {

 		 alert("Please don't tamper with this field")
 		 document.update.elements[0].focus();
}




//-->
		</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">

      <p><b>Manual Invoice - <%=request("location")%> Invoice</B><br>
        <A HREF="default.asp">Back to Search</A></p>
      <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
      <table width="610">
        <TR> 
          <TD> 
            <!--- You can locate a lease by it's <%IF request("location") 
= "Booked" THEN response.write "lease" ELSE response.write "application"%
> number by typing it in to the <%IF request("location") = "Booked" THEN 
response.write "lease" ELSE response.write "application" %> # field on 
the form.  Then hit TAB and the page will reload with the new <%IF request
("location") = "Booked" THEN response.write "lease" ELSE 
response.write "application" %> information. Just remember that any 
information you change is not saved in LeasePak. <BR> -->
            The assessments and descriptions you submit will be saved on 
your 
            computer for approximately 20 minutes. Every time you submit 
the page, 
            the time limit will be renewed. </td>
        </TR>
      </table>
      <% IF request.querystring("update") = 1 THEN %>
      <font color="red">Your invoice has been processed. Select an 
invoice style.</font> 
      <table>
        <TR> 
          <TD> 
            <Form name="report" method=post action="New_M&IInvoice.rpt" 
onSubmit="invoice()">
              <input type="hidden" name="prompt0" value=0 size="5">
              <input type="submit" name="FNL" value="FNL" >
            </form>
          </TD>
          <TD> 
            <Form name="report1" method=post 
action="New_M&IInvoice_CN.rpt" onSubmit="invoice1()">
              <input type="hidden" name="prompt0" value=0 size="5">
              <input type="submit" name="CN" value="CN">
            </form>
          </TD>
        </TR>
      </table>
      Total amount: 
      <% If Not Recordset2.EOF Or Not Recordset2.BOF Then %>
      <%= FormatCurrency((Recordset2.Fields.Item("Expr1").Value), -1, -
2, -2, -2) %> 
      <% End If ' end Not Recordset2.EOF Or NOT Recordset2.BOF %>
      <HR width="200" align="left">
      <P><font color="red">If you would like to issue another invoice 
without 
        going back to the search screen, please enter a new 
        <%IF request("location") = "Booked" THEN response.write "lease" 
ELSE response.write "application"%>
        number and hit <B>Tab</B>.</font> </p>
      <% end if %>
      <form ACTION="<%=MM_editAction%>" METHOD="POST" name="update">
        <table border="0" width="609">
          <TR> 
            <TD colspan="2">&nbsp;</TD>
            <td >&nbsp;</Td>
            <TD colspan="2">Billing Address</TD>
          <tr> 
            <td > 
              <%SELECT CASE request("location") 
CASE "Booked"%>
              Lease # 
              <%CASE "Application"%>
              Application # 
              <% END SELECT %>
            </td>
            <TD > 
              <%SELECT CASE request("location") 
CASE "Booked" %>
              <input type="text" name="lse_s" value="<%=
(Recordset1.Fields.Item("lse_s").Value)%>" maxlength="50" size="10" 
onChange="location.href='detail.asp?location=<%=request("location")%
>&lse='+ document.update.lse_s.value;">
              <%CASE "Application" %>
              <input type="text" name="app_s" value="<%=
(Recordset1.Fields.Item("app_s").Value)%>" maxlength="50" size="10" 
onChange="location.href='detail.asp?location=<%=request("location")%
>&app=' + document.update.app_s.value;">
              <% END SELECT %>
              <br>
              <input type="checkbox" name="show_lse" checked>
              <font size="-1">Show lease # on invoice</font> </td>
            <TD >&nbsp;</TD>
            <TD >Name</TD>
            <TD > 
              <%if isnull (Recordset1.Fields.Item("lse_cty").Value) then%>
              <input type="text" name="Bill_nam_s" value="<%=
(Recordset1.Fields.Item("bill_nam_s").Value)%>" size="40" maxlength="75">
              <%else%>
              <input type="text" name="Bill_nam_s" value="<%=
(Recordset1.Fields.Item("lse_nam").Value)%>" size="40" maxlength="75">
              <%end if%>
            </TD>
          </tr>
          <tr> 
            <TD >Lessee #</TD>
            <td > 
              <input type="text" name="les_s" value="<%=
(Recordset1.Fields.Item("les_s").Value)%>" size="10" maxlength="10">
            </TD>
            <TD >&nbsp;</TD>
            <TD >Address</TD>
            <TD > 
              <%if isnull (Recordset1.Fields.Item("lse_cty").Value) then%>
              <input type="text" name="bill_add_s" value="<%=
(Recordset1.Fields.Item("bill_add_s").Value)%>" size="40" maxlength="100">
              <%else%>
              <input type="text" name="bill_add_s" value="<%=
(Recordset1.Fields.Item("lse_add").Value)%>" size="40" maxlength="100">
              <%end if%>
            </TD>
          </TR>
          <tr> 
            <TD >Invoice Date</TD>
            <td > 
              <input type="text" name="Invoice_date" value="<%=date()%>" 
size="10" maxlength="10">
            </TD>
            <TD >&nbsp;</TD>
            <TD >Address2</TD>
            <TD > 
              <%if isnull (Recordset1.Fields.Item("lse_cty").Value) then%>
              <input type="text" name="bill_add2_s" value="<%=
(Recordset1.Fields.Item("bill_add2_s").Value)%>" size="40" maxlength="75">
              <%else%>
              <input type="text" name="bill_add2_s" value="<%=
(Recordset1.Fields.Item("lse_add2").Value)%>" size="40" maxlength="75">
              <%end if%>
            </TD>
          </TR>
          <tr> 
            <TD >Client Name</TD>
            <td > 
              <input type="text" name="nam_long_s" value="<%=
(Recordset1.Fields.Item("nam_long_s").Value)%>" size="40" maxlength="100">
            </TD>
            <TD >&nbsp;</TD>
            <TD >City</TD>
            <TD > 
              <%if isnull (Recordset1.Fields.Item("lse_cty").Value) then%>
              <input type="text" name="bill_cty_s" value="<%=
(Recordset1.Fields.Item("bill_cty_s").Value)%>" size="25" maxlength="25">
              <%else%>
              <input type="text" name="bill_cty_s" value="<%=
(Recordset1.Fields.Item("lse_cty").Value)%>" size="25" maxlength="25">
              <%end if%>
            </TD>
          </TR>
          <tr> 
            <TD >&nbsp;</td>
            <TD >&nbsp;</TD>
            <TD >&nbsp;</TD>
            <TD >State</TD>
            <TD > 
              <%if isnull (Recordset1.Fields.Item("lse_cty").Value) then%>
              <input type="text" name="bill_st_s" value="<%=
(Recordset1.Fields.Item("bill_st_s").Value)%>" size="2" maxlength="10">
              <%else%>
              <input type="text" name="bill_st_s" value="<%=
(Recordset1.Fields.Item("lse_st").Value)%>" size="2" maxlength="10">
              <%end if%>
            </TD>
          </TR>
          <tr> 
            <TD colspan="2">&nbsp;</TD>
            <TD >&nbsp;</TD>
            <TD >Zip</TD>
            <TD > 
              <%if isnull (Recordset1.Fields.Item("lse_cty").Value) then%>
              <input type="text" name="bill_zip_s" value="<%=
(Recordset1.Fields.Item("bill_zip_s").Value)%>" size="10" maxlength="75">
              <%else%>
              <input type="text" name="bill_zip_s" value="<%=
(Recordset1.Fields.Item("lse_zip").Value)%>" size="10" maxlength="75">
              <%end if%>
            </TD>
          </TR>
          <TR> 
            <TD colspan="5">&nbsp;</TD>
          </TR>
          <tr> 
            <TD colspan="5">Lease Description 
              <input type="text" name="lease_description" value="<%=
(Recordset1.Fields.Item("desc_s").Value)%>" size="70">
            </TD>
          </TR>
          <TR> 
            <TD>Lease Type</td>
            <TD> 
              <input type="radio" name="LeaseType" value="L" 
selected="yes" checked>
              Lease 
              <input type="radio" name="LeaseType" value="R">
              Residual </TD>
            <TD >&nbsp;</TD>
            <TD >Payment Due Date</TD>
            <TD > 
              <% yourdate=dateadd("D", 15, date()) %>
              <input type="text" name="Payment_due_date" value="<%
=yourdate%>" size="15" maxlength="50">
              <BR>
              <font size="-1">(today plus 15 days)</font> </TD>
          </TR>
          <TR> 
            <TD colspan="5">Description on Return 
              <input type="text" name="description_on_return" size="70" 
maxlength="150">
            </TD>
          </TR>
          <TR> 
            <TD colspan="5">&nbsp; </TD>
          </TR>
          <TR> 
            <TD colspan="2">Assessment Descriptions</TD>
            <TD >&nbsp;</TD>
            <TD colspan="2">Assessments</TD>
          </TR>
          <TR> 
            <TD colspan="2"> 
              <textarea name="assess_1_text" cols="50" 
onkeypress=CheckLength1()><%=assess_1_text%></textarea>
            </TD>
            <TD >&nbsp;</TD>
            <TD colspan="2" valign="bottom" > 
              <input type="text" name="assessment_1" size="10" value="<%
=assessment_1%>" onBlur="calcTotal()">
			 
            </TD>
          </TR>
          <TR> 
            <TD colspan="2"> 
              <textarea name="assess_2_text" cols="50" 
onkeypress=CheckLength2()><%=assess_2_text%></textarea>
            </TD>
            <TD >&nbsp;</TD>
            <TD colspan="2" valign="bottom" > 
              <input type="text" name="assessment_2" size="10" value="<%
=assessment_2%>" onBlur="calcTotal()">
            </TD>
          </TR>
          <TR> 
            <TD colspan="2"> 
              <textarea name="assess_3_text" cols="50" 
onkeypress=CheckLength3()><%=assess_3_text%></textarea>
            </TD>
            <TD >&nbsp;</TD>
            <TD colspan="2" valign="bottom" > <align top> 
              <input type="text" name="assessment_3" size="10" value="<%
=assessment_3%>" onBlur="calcTotal()">
            </TD>
          </TR>
          <TR> 
            <TD colspan="2"> 
              <textarea name="assess_4_text" cols="50" 
onkeypress=CheckLength4()><%=assess_4_text%></textarea>
            </TD>
            <TD >&nbsp;</TD>
            <TD colspan="2" valign="bottom" > 
              <input type="text" name="assessment_4" size="10" value="<%
=assessment_4%>" onBlur="calcTotal()">
            </TD>
          </TR>
          <TR> 
            <TD colspan="2" > 
              <textarea name="assess_5_text" cols="50" 
onkeypress=CheckLength5()><%=assess_5_text%></textarea>
            </TD>
            <TD  >&nbsp;</TD>
            <TD colspan="2" valign="bottom"  > 
              <input type="text" name="assessment_5" size="10" value="<%
=assessment_5%>" onBlur="calcTotal()">
            </TD>
          </TR>
          <TR> 
            <TD colspan="2"> 
              <textarea name="assess_6_text" cols="50" 
onkeypress=CheckLength6()><%=assess_6_text%></textarea>
            </TD>
            <TD >&nbsp;</TD>
            <TD colspan="2" valign="bottom" > 
              <input type="text" name="assessment_6" size="10" value="<%
=assessment_6%>" onBlur="calcTotal()">
              
             </TD>
          </TR>
          <TR> 
            <TD colspan="2" align="right" valign="top">Total</TD>
            <TD >&nbsp;</TD>
            <TD colspan="2"> 
              <input type="text" name="total" value="" onFocus="dissallow
()" size="10">
              <br>
              <input type="hidden" name="Username" value="<%=session
("UserID")%>">
              <input type="submit" name="Submit" value="Submit" 
onClick="MM_validateForm
('assessment_1','','NisNum','assessment_2','','NisNum','assessment_3','','
NisNum','assessment_4','','NisNum','assessment_5','','NisNum','assessment_
6','','NisNum');return document.MM_returnValue">
            </TD>
          </TR>
        </table>
        <input type="hidden" name="MM_insert" value="true">
      </form>
      <% else %>
      There are no results. Please try your search again. 
      <% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>

</body>
</html>
<%
Recordset2.Close()
%>

  Return to Index