If I enter today's date in Box 1, how can I get Box 2 to auto-fill the same date +30 days?


if enter today's date in box 1, how can box 2 auto-fill same date +30 days?

you can use following script custom calculate script box 2 field:

 

// custom calculate script box 2 field
(function () {

    // date field
    var v = getfield("box1").valueasstring;

    // convert string date
    var d = util.scand("mm/dd/yyyy", v);

    // add 30 days
    d.setdate(d.getdate() + 30);

    // populate field result
    if (v) {
        event.value = util.printd("mm/dd/yyyy", d);
    } else {
        event.value = "";
    }

})();

 

replace "box1" in code above actual name of field.



More discussions in JavaScript


adobe

Comments