Skip to main content
Known Participant
May 5, 2016
Question

How do I disable all fields when sending a pdf through the "submit a form" button?

  • May 5, 2016
  • 1 reply
  • 11940 views

I want to make sure that the fillable fields will not be editable when received via email.

Thank you!

This topic has been closed for replies.

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
May 5, 2016

If this solution needs to work in both Adobe Acrobat and the free Adobe Reader, your only option is to set the fields to read-only in your form. You can do this by running a loop over all fields and then set the "readonly" property to "true":

for (var i=0; i<this.numFields; i++) {

    this.getField(this.getNthFieldName(i)).readonly = true;

}

Depending on how your button is set up, you may have to add two different actions (or add this script to your already existing JavaScript action):

Known Participant
May 5, 2016

That's fantastic. (And forgive me for my lack of knowledge with regard to Adobe Acrobat...I'm learning, but it's going slowly..) The ultimate goal is that the "disabled" form is only disabled when it is sent via email. Now the issue I'm running into is that the code also locks the "reset form" button which is crucial for filling out the document again for a new client.  Any solutions??

Karl Heinz  Kremer
Community Expert
Community Expert
May 5, 2016

I think I may have answered my own silly question...I think this is just a "visible but doesn't print" issue...


That's one option (especially if the output gets printed), but you can also add another action to your submit button: I guess you already have two:

- The JavaScript action to set the fields to read-only

- The "Submit a form" action to actually send your form

Just add a third one that run another JavaScript in which you show these buttons again. The property you need to use is the Field.display property, which can be set to the values you can find here: Acrobat DC SDK Documentation