I really appreciate your help. There is a working version I wrote( with help from
a forum some years ago) being used by a former employer. I have since retired and
am enjoying the effect of ageing. Now I am using this (localhost) project to
keep the grey matter intact(somewhat).
I want to enter PAIDAMT & when clicking away from
that field, have the current (DATEPAID) autoinserted & based on function calcs, manipulate
CHECKNO, AMTDUE, PD & PREVBAL.
-----------------------following is current code----------------------------
[code] function $_(IDS) { return document.getElementById(IDS); }
function calculate_paid()
{
var recur = parseInt(document.getElementById("recur").value);
var pd = parseInt(document.getElementById("pd").value);
var shipamt = parseFloat(document.getElementById("shipamt").value);
var paidamt = parseFloat(document.getElementById("paidamt").value);
var prevbal = parseFloat(document.getElementById("prevbal").value);
var amtdue = parseFloat(document.getElementById("amtdue").value);
var checkno = parseInt(document.getElementById("checkno").value);
/* set up datepaid
var datepaid = parseInt(document.getElementById(“datepaid”).value);
var dateNow = new Date();
var dayNow = dateNow.getDate();
var datePaid = (dateNow.getMonth()+1)+"/"+dateNow.getDate()+"/"+dateNow.getFullYear();
datepaid.value = datePaid;
/* increment the check#
checkno.value = parseIntb + “1”[/b];
/* if not a recurring account, adjust the “amtdue”, if total paid, PD = “p”, PREVBAL = “0.00”
if(recur.value==“N”)
{
amtdue.value = parseFloat(amtdue.value) + parseFloat(shipamt.value) - parseFloat(paidamt.value);
if(amtdue.value==“0.00”)
{ prevbal.value = “0.00”; pd=“P”; }
/* if a recurring account, adjust the “prevbal”, if total paid, PD = “p”, PREVBAL = “0.00”
prevbal.value = parseFloat(prevbal.value) + parseFloat(amtdue.value) + parseFloat(shipamt.value) - parseFloat(paidamt.value);
if(prevbal.value==“0.00”)
{ pd=“P”; }
}[/code]
-----------------------------following is original WORKING code ---------------------------
[code]function $_(IDS) { return document.getElementById(IDS); }
function calculate_paid() {
var amtpaid = document.getElementById(“amtpaid”);
var rentdue = document.getElementById(“rentdue”);
var prevbal = document.getElementById(“prevbal”);
var hudpay = document.getElementById(“hudpay”);
var tentpay = document.getElementById(“tentpay”);
/* set up datepaid
var datepaid = document.getElementById(“datepaid”);
var late = document.getElementById(“late”);
var paidsum = document.getElementById(“paidsum”);
var dateNow = new Date();
var dayNow = dateNow.getDate();
var datePaid = (dateNow.getMonth()+1)+"/"+dateNow.getDate()+"/"+dateNow.getFullYear();
datepaid.value = datePaid;
in the current (above) code, the following are decremented
instead of incremented.************
paidsum.value = parseInt(paidsum.value) + parseInt(amtpaid.value);
tentpay.value = parseInt(tentpay.value) + parseInt(amtpaid.value) - parseInt(hudpay.value);
if(dayNow > 5) { late.value = “L”; rentdue.value = rentdue.value + 10; }
[/code]
-----------------------------following is original WORKING code ---------------------------
[php]echo "
|
|
|
|
|
|
|
|
|
|
|
";[/php]
-----------------------following is current code----------------------------
[php]echo "
|
|
|
[b] | [/b]
|
[b] | [/b]
|
|
|
";
[/php]