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

lock fields

JayF
Registered: Aug 7 2010
Posts: 12

I have a form that have many fields on it. The customer wants to do the following:
 
After certain specific fields are filled out, only those fields (not any others) should be locked; and then the form should be saved with Reader enablement.
 
I want to make this process as easy and convenient for them as possible. I was thinking that perhaps a Document Action could be used such that upon Document Did Save, those specific fields would be locked and unchangeable, and also, at the same time, the form will become Reader enabled.
 
Oh boy, I am not a programmer. Can anyone point me to a script that could be used for this purpose or perhaps give me some hints on how to go about accomplishing this? (Also posted this on Acrobat Scripting forum, hoping someone can help.)

Jay

My Product Information:
Acrobat Pro 9.4, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi JayF,

You cannot access the Enabling features via a script- that has to be done in Acrobat Pro or Stnd.

You can use a script to set a field or fields to Read Only after they are filled or when the Save/Submit button is clicked. This has been discussed here many times so if you search on "lock fields" or "Read Only" you should find some examples and a variety of use scenarios.

Hope this helps,

Dimitri
JayF
Registered: Aug 7 2010
Posts: 12
Dmitri,
Thanks for your reply. I did do a search prior to posting. I was able to find some posts regarding LiveCycle, but not about Acrobat forms. George Johnson, in the Adobe Acrobat Scripting forum,suggested:

// Set some fields to read-only
getField("Text1").readonly = true;
getField("Text2").readonly = true;
// etc.

However, it is not working for me. This is the procedure I followed:

1) I started with a form that was not Reader enabled.
2) For the Document Will Save action, I have:
getField("txtTripName").readonly = true;
3) I then extended the form for Reader users.
4) Saved the PDF.
5) Closed and reopened it in Acrobat.
6) Typed some text into the field that needs to be locked and read-only.
7) Saved the PDF with a new name.
8) Reopened the PDF. And, I'm able to edit the field that should be locked -- it shouldn't be editable, so I've gone wrong somewhere in this process.

If you or anyone else knows how to solve this problem, I'd love to hear from you.

Jay

JayF
Registered: Aug 7 2010
Posts: 12
Dmitri,
I was able to get the George's script to work. User error. Everything okay now.
Thanks.

Jay