I have a fillable form and I currently run a calculation script to determine the date to depart a quarantine location on the 17th day of arrival. Since creating this form my company has added another location but this location the employee will depart on the 15th day of arrival.
I want to use a set of radio buttons to determine how many days will be added to the arrival date to set the departure date. Below is my current script that adds 16 days to the arrival date.
var date= util.scand("dd-mmm-yyyy", this.getField("Leave End Date Field").value);
date.setDate(date.getDate()+16)
event.value=util.printd("dd-mmm-yyyy",date)
if (getField("Leave End Date Field").value=="")event.value=""
I want a new script that will add either 16 days or 14 days depending on which radio button is checked. I’m guessing this will require an IF/Else statement but I’m not sure how to write it in combination with radio button choices.
I will appreciate all assistance anyone has to offer.