Skip to main content

How to Change a PDF Form to Read-Only Before the User Submits

I am a Web Marketing Manager, Graphic Designer, Web Developer, Internet Marketing Manager, and Event Photographer.

Interactive PDF forms are very useful for a variety of projects. It is a great alternative to web forms while keeping the same interactive attributes. Interactive PDF forms are not only easy to create, they are accessibly on multiple platforms creating a solution for a wide variety of needs.

In the first tutorial I go over how to create the actual form with text fields, buttons, radio buttons, and the reset/submit actions. Adobe Acrobat has a lot more to offer than just basic forms, and it is an incredible tool for businesses. There are specific situations where the fields need to be editable for the user to fill out, but when the information is submitted to its designated destination, the information needs to be locked so that it cannot be changed on the receiving end.

There are a few different solutions to this such as having the user save as an image and then email, or to change the form to read-only on their end before sending. As I have mentioned in several other hubs, the ultimate goal is the make the task as easy as possible for the user. By requiring the user to do extra work it leaves a lot of room for error, whether they forget to complete a step or they don't understand the instructions. Not only is this not efficient for your user, it may also deter users from completing the information that you need out of frustrations.

Select Trigger "Mouse Up"

Select Trigger "Mouse Up"

Choose "Run a JavaScript"

Next, go to the drop down for “Select Action” and choose “Run a JavaScript.” Once you choose this, another box will appear that will allow you to enter code.

Adding a Simple Script

The best way to make a PDF form read-only on the receiving end is to add a simple script to a button that will be selected before submitting the form. This button can be as simple as adding text such as “I agree that this information is correct” or even saying “by clicking here you are submitting your digital signature.” The button itself when selected will run a quick script that will make the PDF read-only, and then the user can select the “submit” options to complete the task. The process listed below is to make all fields in the entire form read-only with one script.

The first step is to create a space on your form for the button with the text that you choose.

Once you set your “general” options for your button, go to “actions” and select “Mouse Up.”


Add The Following Script

Add the following code and choose “ok”:

for (var i = 0 ; i < this.numFields ; i++) {
var f = this.getField(this.getNthFieldName(i)) ;
if (f.type != "button") // do I have to change the word between " " with the name of my button which I put on my PDF? name of button is "Valider"
f.readonly = true ;

Once you choose ok that screen will close, and you should now see the added action in your action field.

Now You Need the Button to be Required

Save your PDF Interactive form. You have now created a button with a script to make the form 'read-only' before sending it to the targeted recipients.

For this to work effectively, you need to make sure the user checks the button that you have created. You now need to make that field required.

When it has been successfully added, you will see that it appears in the "actions" field.

When it has been successfully added, you will see that it appears in the "actions" field.

Go back to your button settings and choose the “general” tab. Under “common properties” check the box “required.” Choose “close,” save your form again and now the user must click that button to be able to send the form. When they choose that required button the form will be changed to a read-only PDF.

Interactive PDF forms are a great alternative to web forms, and can be used for a variety of projects. They are easy to create, accessible for a wide variety of users and can be printed, saved or emailed when submitting.


This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.

© 2012 dappledesigns


Le quan anh loc on September 28, 2018:

But after it's locked any script that can reopen the file ?

Appreciate for you help.

FaisalFaissi on September 21, 2018:

really very awesome post, Thank you so much for this post this is very helpful.

Reina on June 29, 2018:

My form requires 4 signatures so I would like my form to be reviewed signed and forwarded to the next person. what do I add to exclude my signature, print, save and submit buttons?

By the way. Thank you for the JavaScript.

Tulasi on September 12, 2017:

Thank you for the explanation on how to make a fillable form read only. Can you let me know how to create a pop up confirmation (OK or Cancel) that the user has done with his changes and wants it to be converted to read only format. When cancel is chosen to go back to form as fillable.

Vanessa on April 23, 2013:

Me again... I found that this doesn't work after you enable usage rights... please help!

Vanessa on April 19, 2013:

Thank you thank you thank you... i've been searching for days through web pages and forums and no help at all until I found your script! Works like a charm!

dappledesigns (author) from In Limbo between New England and the Midwest on April 13, 2013:

@Eros - I think I understand now what you are asking. By choosing the "read-only" button, the script is initiated to run. Depending on the version of software, it will sometimes default to run when submitted. When you go in to set the "mouse up" options of the action on the button (the check mark to run the script) you should be able to go in and choose when to run the action. For example, if you choose for the script to run only when the form is submitted, as opposed to when the box is checked. You can also choose to add a "reset" button on the form. In the reset options, you can have it reset all fields and scripts when used. This will clear all info already put in the form, but it will release the script.

Eros on April 03, 2013:

further to my previous post: the reason seems to be that even if the check mark is removed from the check box (which by the way needs to be done in editing mode since the script also turn the check box as read-only), the read-only status is left on all of the other fields and if something needs to be revised, first you need to remove the read-only mark in editing mode before you can edit the field. What I would like to have is that that when the (hidden) check mark is removed, all fields turn again editable. Hpe you can understand what I want :)

Eros on April 03, 2013:

I still cannot make it work like would: I can create the button with script which makes the form read-only. But I cannot turn the document back to read-and-write, even if the button is unchecked / read-only check removed / entire button and script removed.

dappledesigns (author) from In Limbo between New England and the Midwest on April 01, 2013:

@Eros - only the user that filled out the form can change it back to revise. They can uncheck the required button and from there edit and resend. The recipient can not change the information.

@Pablo - I'm so glad you found it helpful!

Pablo on March 31, 2013:

Thank you very much!! I've been looking for a simple script to lock pdf file for quite a while. This fits the bill exactly.

Eros on March 19, 2013:

This was very helpful, thanks. However, is there any way to turn the read-only form back to accessible, if something needs to revise etc.?

dappledesigns (author) from In Limbo between New England and the Midwest on January 09, 2013:

Did you create the read-only button after the submit button was created?

Carol on January 09, 2013:

This is helpful, thanks! However, when it turns into a read-only form the Submit/Email button is deactivated as well, so the user can't submit the form. Any help with that would be appreciated.