PDF Form - Auto Date Dropdown Field Needs to Default to Today
I'm using this code to populate a dropdown with dates 30 days prio to today and 60 days after today. The client would like for Today to be selected by default when the form is opened. I appreciate any help you can give.
var aDateList = [];
var nToday = (new Date).getDate();
var dtItem;
for(var i=-30;i<60;i++)
{
dtItem = new Date;
dtItem.setDate(nToday + i);
aDateList.push(util.printd("mm/dd/yyyy", dtItem));
}
this.getField("DateList").setItems(aDateList);
