Skip to main content
dhhsc84757271
Known Participant
April 22, 2016
Question

Is it possible to use javascript to get to auto populate date AND lock the form?

  • April 22, 2016
  • 1 reply
  • 1384 views

I am using Adobe Pro XI, I have a script that will auto populate the date once digitally signed.  I need to know how to also get the form to lock based on that signature as well.  Looking at the Properties for SIGNED, it appears that I can only choose "lock all fields" or enter a script.  The script I am currently using is:

var currentTime = new Date()

var month = currentTime.getMonth()+1

var day = currentTime.getDate()

var year = currentTime.getFulYear()

var signingTime = month+"/"+day+"/"+year

var f = this.getField("Date");

f.value = signingTime;

This works perfectly for auto-populating the date in another field, but I need to also lock the form.  Is there something I can add to this script to accomplish that?

Thank in advance.

This topic has been closed for replies.

1 reply

Inspiring
April 22, 2016

With Acrobat JavaScript it is possible to make each field in the form read only.

But anyone with a little knowledge can undo that.

If you really need to lock down a form or at least detect if the form have been changed apply a digital signature or certify the PDF.

dhhsc84757271
Known Participant
April 22, 2016

thank you for responding, but that doesn't answer my question.  I'm aware of the digital signature capabilities.  I also know the date is stamped on the signature as well.  The issue is the font for the digital signature is so small, some in my department can't read it so they still want a text field that shows he date.  That's why I need to modify or add to the current script  in order to accomplish both the actions: Auto populate the date AND lock the fields all based on the digital signature.

Inspiring
April 22, 2016

There is a navigational panel for signatures that provides all the information about the signature  There is also the loupe tool that can magnify portions of the PDF.

The signature field properties has an option for selecting all fields, fields to exclude or fields to include. No scripting needed.

The above option is only available at the time the signature field is added.