Can Acrobat auto populate a date field upon digital signature of a form?

New Here ,
Oct 18, 2012 Oct 18, 2012

Copy link to clipboard

Copied

We use several fillable forms with digital ID signature fields.  A business rule requires a date field next to the signature field.  Is it possible to define the date field to auto populate once the user signs the form?  I can't check this in Acrobat since I only have the reader.

TOPICS
Security digital signatures and esignatures

Views

35.1K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Oct 18, 2012 Oct 18, 2012

Hi,

The short answer is yes, but of course you'll need to get Acrobat to edit the PDF file.

Generically, here is what  you are looking to do:

  1. Open the Digital Signature Properties dialog
  2. Select the Signed tab
  3. Select the This script executes when the field is signed radio button
  4. Click the Edit button
  5. Add the code snippet below to the JavaScript editor
  6. Click the OK button on the JavaScript editor
  7. Click the Close button on the Digital Signature Properties dialog

// JavaScript code to add the date at signin

...

Likes

Translate

Translate
Adobe Employee ,
Oct 18, 2012 Oct 18, 2012

Copy link to clipboard

Copied

Hi,

The short answer is yes, but of course you'll need to get Acrobat to edit the PDF file.

Generically, here is what  you are looking to do:

  1. Open the Digital Signature Properties dialog
  2. Select the Signed tab
  3. Select the This script executes when the field is signed radio button
  4. Click the Edit button
  5. Add the code snippet below to the JavaScript editor
  6. Click the OK button on the JavaScript editor
  7. Click the Close button on the Digital Signature Properties dialog

// JavaScript code to add the date at signing time

    var currentTime = new Date()

    var month = currentTime.getMonth() + 1

    var day = currentTime.getDate()

    var year = currentTime.getFullYear()

    var signingTime = day +"/"+month+"/"+year  //Modify into your preferred format

    var f = this.getField("Text1");  //Modify the field name as necessary

    f.value = signingTime;

Good luck,

Steve

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2015 Dec 10, 2015

Copy link to clipboard

Copied

I've got the JavaScript to work but I don't know enough about it to fix the issue I'm encountering with the month and day being switch. For example, if i sign the form today, the date populated is showing October 12, 2015.

How would I fix this?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 14, 2015 Dec 14, 2015

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2016 Mar 12, 2016

Copy link to clipboard

Copied

Go into the properties of the field that you have the date populating in. Click the "Format" tab and select the date format category. After that you will scroll all the way down to the bottom of the box with the date formats and select "Custom". It will populate a field just below it that will allow you to write the date format as you see fit.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2018 Jul 18, 2018

Copy link to clipboard

Copied

I was able to get the date to populate correctly! Thank you @Steven.Madwinfor the helpful information. One more thing I would like to ask of you. Now that I have the date auto populating on the form when digitally signed, how do I make the form read only at the same time it is digitally signed? I am not able to select "Mark as read-only" and "This script executes when field is signed" buttons at the same time. Is it even possible?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 15, 2018 Aug 15, 2018

Copy link to clipboard

Copied

Hi rsimpson258,

Since you are digitally signing the file, as long as it's the last signature field being signed you have the option to lock the document, which effectively makes all of the form controls read-only. Select this checkbox circled below and the file will end up being read-only.

Sign Dialog.png

Steve

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 07, 2019 Oct 07, 2019

Copy link to clipboard

Copied

Thank you Steven for the assistance. I have completed the date field, but also want to make fields read only. However, I have 3 different signature fields on my form and would only like to make certain fields read only once the signatures and signed in sequence. Thank you for your assistance.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 07, 2019 Oct 07, 2019

Copy link to clipboard

Copied

Hi, I see this is an old thread. Adding to the suggestions above, I used this script in "Actions" --->>> Run a javascript instead. It worked for me : this.getField("yourotherTextField).value = util.printd ("yyyymmdd", new Date()); and then in the textfield that you want this date from signing time use Custom Calculation Script adding this line: var s = this.getField("SignatureField").value; if (s=="") event.value = ""; To only make certain fields read-only , right-click on the signature field---> Properties---> Digital Signature Properties---> click on the "Signed" tab. Then slect the radio button that is labeled "Mark as read-only:" . The pulldown menu that appears greyed out next to it wil become active and you will be able to choose "just these fields". An itemized list will open will all the fields in your document than you can tick or untick to select specifically which ones you want as read-only after a digital signature is applied.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 17, 2019 Oct 17, 2019

Copy link to clipboard

Copied

Hi, I am facing same issue as need to populate date field with current date automatically when user digitally signed...I am trying to follow the above steps but i don't see any Digital Signature Properties option when i right click on the signature field in Adobe Live Cycle design, Kindly help on this as its bit urgent

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 17, 2019 Oct 17, 2019

Copy link to clipboard

Copied

The script is not for LiveCycle Designer forms.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 19, 2019 Oct 19, 2019

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

I know this is an old thread but I know nothing about javascript and could use some assistance. The code works just as needed for me except for the date format, so how do I change it so the date is formatted as MM/DD/YYYY?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

LATEST

dang it, never mind .... just switch the date and month there.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2020 Apr 25, 2020

Copy link to clipboard

Copied

I'm wondering if there's a way to do a similar thing but with the signers name? Is there script that will pull the individuals name from the signature and auto populate it into a designated text box?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 25, 2020 Apr 25, 2020

Copy link to clipboard

Copied

Yes you can but is complicated.

 

I asked this question before in an older thread.

 

In the case of government forms,  the individual who signs have to apply a digital signature to many fields and also type in printed name and select date.

 

This is time consuming so it is possible to get signature and date  information.

 

This is vaguely covered in the Adobe Acrobat DC  SDK - Developing Acrobat Applications Using Javascript, "Getting Signature Information from another user", pages 163-165.

 

You have to do some serious readeing and figure out how the SignatureInfo object properties of the security handler works.

 

You'll need also to read about SeedValue  and the SecurityHandler object found in the Acrobat JavaScript Scripting Reference, "Field Methods", pages 270-275.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 02, 2020 May 02, 2020

Copy link to clipboard

Copied

+++ EDITED REPLY (some corrections made)

 

As a matter of fact yes. If you read the referenced pages  that I posted earlier you can get the Distinguished Name from the digital certificate used in the signature field (there are more code examples in Page 334).

 

To do so declare a variable using the "signatureInfo()" to call the signatureInfo Object and also decalre a variable with "sigInfo" to pull from the signatureInfo object the Distinguished Name label that was used in the digital certificate of  the digital ID.

 

In your signature field, select Properties from the context menu and go to the "Sign" tab. Then tick the radio button "This script executes when field is signed" and place the following script there as shown in the slide below:

 

 

 

 

 

var f = this.getField("Signature");
var sigInfo = f.signatureInfo();
var cert = sigInfo.certificates[0];
this.getField("Text1").value =  cert.subjectDN.cn;

 

 

 

 

 

 

distinguishname.png

 

 

 

The script will copy the Distinguished Name label  to the field "Text1" in my example above.

 

 

 

 

 

 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 02, 2020 May 02, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 25, 2020 Apr 25, 2020

Copy link to clipboard

Copied

Just a reminder: a digital signature is necessarily dated.

😉

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines