Who can help me with a calculated date to a drop down box?
I'm trying to add 2 calculated dates to a drop down for the release date on a form I am currently working on. I can get the 1st one in there but not the 2nd. In the "Options" tab I only have "Permanent" listed. In the "Calculate" tab I have the following custom calculation script:
(function () {
// Get date from field
var v = getField("Today").value;
if (v) {
// Convert string to date
var d = util.scand('mm/dd/yyyy', v);
// Add 14 days
d.setDate(d.getDate() + 14);
// Set value of this field to the new date
event.value = util.printd("mm/dd/yyyy", d);
} else {
// Blank field if no date entered
event.value = "";
}
})();(function () {
// Get date from field
var v = getField("Today").value;
if (v) {
// Convert string to date
var d = util.scand('mm/dd/yyyy', v);
// Add 180 days
d.setDate(d.getDate() + 14);
// Set value of this field to the new date
event.value = util.printd("mm/dd/yyyy", d);
} else {
// Blank field if no date entered
event.value = "";
}
})();
The Release Date dropdown would show the following date options:
- “Today’s Date” + 14 days
- “Today’s Date” + 180 days
- Permanent
