how to calculate a date based of another date and a dropdown box ?
Hi, I have this code that allow me to give a date based on another date :
var cDate = this.getField("DateDebut18").value;
if (cDate) {
var d1 = new Date();
d1 = util.scand("dd/mm/yyyy", cDate);
d1.setFullYear(d1.getFullYear() + 1); // this adds one year
d1.setDate(d1.getDate() - 1); // this subtracts one day
event.value = util.printd("dd/mm/yyyy", d1);
}
However, I need a code that allow me to obtain a date based on another date and the value of a dropdown box that have three options : 1 year, 2 years, 3 years. What is the code ? Thank you.
