These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Locking fields in increments

FayeC
Registered: Jan 9 2008
Posts: 15
Answered

Hi,

I am trying to figure out how to accomplish the following:

Design a form with 3 fields where each needs to be locked by a different department as they add content and pass the form forward to the next department.
I can't figure out how to do that after the form is given Acrobat Reader rights.
Would each department need to have a copy of Adobe Acrobat Professional in order to accomplish this?
Could it be done programmatically?

Thank you in advance,

FayeC

My Product Information:
Acrobat Pro 8.1.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes it can be done programatically. You would first need a way to activate and control the locking. For example, a check box for each department.

The simplest way to lock a field is to make it read only. Like this

this.getField("MyFld").readonly = true;

Here's an article on creating disabled fields. This could be a way for you to do this.

http://www.acrobatusers.com/tutorials/2007/js_disabling_fields/

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

FayeC
Registered: Jan 9 2008
Posts: 15
I had followed that example and was able to create the greying out/disabling of the fields.
The only problem is that anybody can enable/disable them by selecting the radio buttons.
I would like to find a way to have the radio buttons password protected so whenever one selects them it asks for a password and if the password is correct the fields are then locked, otherwise it will reject the locking and rever to unlocked.
Could this possibly be accomplished?

FayeC

thomp wrote:
http://www.acrobatusers.com/tutorials/2007/js_disabling_fields/
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
It can't be done in a secure way, and it's not simple, but yes, you could do it. For example, place code on the check box to first display a dialog that asks for a password. Then check it against some internal value before allowing the check box to be changed. This internal value would be hard coded in the documents JS so anyone sophisticated and motivated enough could figure out how to get at it. But for most people this would not be a problem. Also, if you protected, or rights enabled the document, you could make it impossible for someone to use Acrobat Pro to easily look at your code.

Now onto the popup password dialog. You could use the "app.response()" box. But a custom dialog would look nicer because you can control the layout and have your own logos. Both options allow for obscured password entry. Find info about custom dialogs at:

http://www.windjack.com/products/acrodialogs.php

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script