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

Updated on April 17, 2017

Finding The Right Solution For Your User

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 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.

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.

Now You Need The Button to be Required

Save your PDF Interactive form, and 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.

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.

Questions & Answers

    © 2012 dappledesigns


      0 of 8192 characters used
      Post Comment

      • profile image

        Tulasi 9 months ago

        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.

      • profile image

        Vanessa 5 years ago

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

      • profile image

        Vanessa 5 years ago

        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 profile image

        dappledesigns 5 years ago from In Limbo between New England and the Midwest

        @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.

      • profile image

        Eros 5 years ago

        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 :)

      • profile image

        Eros 5 years ago

        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 profile image

        dappledesigns 5 years ago from In Limbo between New England and the Midwest

        @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!

      • profile image

        Pablo 5 years ago

        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.

      • profile image

        Eros 5 years ago

        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 profile image

        dappledesigns 5 years ago from In Limbo between New England and the Midwest

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

      • profile image

        Carol 5 years ago

        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.


      This website uses cookies

      As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

      For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: ""

      Show Details
      HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
      LoginThis is necessary to sign in to the HubPages Service.
      Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
      AkismetThis is used to detect comment spam. (Privacy Policy)
      HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
      HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
      Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
      CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
      Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
      Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
      Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
      Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
      Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
      Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
      VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
      PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
      Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
      MavenThis supports the Maven widget and search functionality. (Privacy Policy)
      Google AdSenseThis is an ad network. (Privacy Policy)
      Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
      Index ExchangeThis is an ad network. (Privacy Policy)
      SovrnThis is an ad network. (Privacy Policy)
      Facebook AdsThis is an ad network. (Privacy Policy)
      Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
      AppNexusThis is an ad network. (Privacy Policy)
      OpenxThis is an ad network. (Privacy Policy)
      Rubicon ProjectThis is an ad network. (Privacy Policy)
      TripleLiftThis is an ad network. (Privacy Policy)
      Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
      Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
      Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
      Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
      ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
      Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)