Get Field to Remain Blank Until User Enters Value in Previous Field Used in Calculation
I am working on a PDF form and am stuck on one of my calculations. There are two fields "Desired Start Date", which is a date entered by the user. The "Desired End Date" is calculated to be one year from date entered by user. I have that figured out-- however, before the user enters a date, I would like that field to remain empty. Currently it fills in with 01/00/000. How can I get that field to not calculate unless a date is entered by the user? So far, I've tried this but can't get the field to remain blank:
//if field “Desired Start Date” is empty, leave “to” field blank
var myStartDate = new Date(this.getField("Desired Effective Date").value);
if (((myStartDate == 0) && (getField("myStartDate").valueAsString === "")) { event.value = "";
//if field “Desired Start Date” has a date entered, use the date to calculate one year from date entered.
}
else {this.getField("to").value = util.printd("mm/dd/yyyy", new Date(myStartDate.getFullYear()+1,myStartDate.getMonth(),myStartDate.getDate()))}
