Quantcast
Channel: Adobe Community: Message List - PDF Forms
Viewing all articles
Browse latest Browse all 57214

Re: Getting both date and time fields to autopopulate upon opening PDF

$
0
0

It's exactly the same, only you use a different date format string. Something like this should work:

 

var dateField = this.getField("CurrentDate");

var timeField = this.getField("CurrentTime");

 

if (dateField.value=="") dateField.value = util.printd("mm/dd/yyyy", new Date());

if (timeField.value=="") timeField.value = util.printd("HH:MM", new Date());

 

Embed this script at the doc-level and it will populate these fields with the current date and time when the file is opened, if they were previously empty.


Viewing all articles
Browse latest Browse all 57214

Trending Articles



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