Hello,
I'm trying to calculate the amount of days past a due date an invoice is. I'm current getting an error of "Object does not support this action." I currently have it set up as an onchange event. Here's the javascript I'm trying to use.
function new_invoiceaging_onchange(){
var d = new Date()
var currentday = new Math.abs(d.getDate())
var currentyear = new Math.abs(d.getFullYear())
var currentmonth = new Math.abs(d.getmonth())
var startday = Math.abs(crmForm.all.duedate.getDate())
var startyear = Math.abs(crmForm.all.duedate.getFullYear())
var startmonth = Math.abs(crmForm.all.duedate.getmonth());
crmForm.all.new_invoiceaging.datavalue = (currentyear - startyear)*365 + (currentmonth - startmonth)*30 + (currentday - startday)*1
crmForm.all.new_financechargeestcalculationdate.dataValue = (currentyeara - startyeara)*0.015 + (currentmontha - startmontha)*0.015/12 + (currentdaya - startdaya)*0.015/365;
}