3 Replies Latest reply on Nov 19, 2010 9:04 PM by jay fresno

    Locking fields

    jay fresno Level 1

      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 unchangable, 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?

        • 1. Re: Locking fields
          George_Johnson MVP & Adobe Community Professional

          The document has to start out Reader-enabled in order for Reader to save it. It would make sense to use the "Document Will Save" event instead. The script would set the fields to read-only. For example:

           

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

          • 2. Re: Locking fields
            jay fresno Level 1

            George,

             

            Thanks so much for your reply and your suggestion.

            Somehow I'm not doing it right.

             

            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.

            • 3. Re: Locking fields
              jay fresno Level 1

              George,

              My most humble apologies. Your script is working perfectly. I left out a space in the field name - duh.

              Thanks so much for your expertise and for answering so quickly! Much appreciated!