Copy link to clipboard
Copied
Hello everyone,
I have created a form where I have an "InputDate" field and a "DateDeducted" field. The "InputDate" being the day a deduction began and the "DateDeducted" is 7 days after to show a payment every week until the "Balance" field is $0.00.
var d = util.scand("mm/dd/yyyy", this.getField("InputDate").valueAsString);
var theTime = d.getTime();
var oneDay = theTime + 7*24*3600*1000;
var dd = new Date(oneDay);
event.value = util.printd("mm/dd/yyyy", dd);
this displays how many weeks it would take to pay off a certain amount.
I have a "Balance" field that is calculated up to $0.00
AmountOwed-AmountDeducted1
What I would like is the next "DateDeducted" field be blank once the balance reaches $0.00
Copy link to clipboard
Copied
As the field's custom Validation script enter this code:
if (event.value==0) event.value = "";