Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 85594

Re: Calculating a due date in Adobe XI using Java script....

$
0
0

It's possible. For it to work like you want, the custom calculate script in the Today field should be:

 

// Custom calculation script

(function () {

 

    // Get a reference to the DueDate field

    var f = getField("DueDate");

 

    if (event.source && event.source === f) {

     // Don't proceed with this script if triggered by a change in the DueDate field

        return;

    }

 

    // Update this field's value to display today's date

    var d = new Date();

    event.value = util.printd("mm/dd/yyyy", d);

 

    // Add seven days to today's date

    d.setDate(d.getDate() + 7);

 

    // Update the DueDate field

    f.value = util.printd("mm/dd/yyyy", d);

 

})();

 

 

But first remove the calculation script from the DueDate field. If you don't make the DueDate field read-only, a user will be able to change it, but it will get reset when any other field value is changed.


Viewing all articles
Browse latest Browse all 85594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>