Javascript Acrobat Set All Fields to Read Only
I am a Web Marketing Manager, Graphic Designer, Web Programmer, Internet Marketing Manager, and Upshot Photographer.
Interactive PDF forms are very useful for a variety of projects. Information technology is a great alternative to spider web forms while keeping the same interactive attributes. Interactive PDF forms are non only like shooting fish in a barrel 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 bodily form with text fields, buttons, radio buttons, and the reset/submit deportment. Adobe Acrobat has a lot more to offering than simply basic forms, and it is an incredible tool for businesses. At that place are specific situations where the fields demand 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 then that it cannot be inverse on the receiving cease.
There are a few different solutions to this such equally having the user salve as an image and and so email, or to change the grade to read-merely on their finish before sending. As I have mentioned in several other hubs, the ultimate goal is the make the task as like shooting fish in a barrel 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 pace or they don't empathize the instructions. Not only is this not efficient for your user, it may as well deter users from completing the information that you lot need out of frustrations.

Select Trigger "Mouse Up"
Cull "Run a JavaScript"
Adjacent, go to the drop down for "Select Action" and choose "Run a JavaScript." Once y'all choose this, another box will appear that will allow y'all to enter lawmaking.
Calculation a Simple Script
The all-time fashion to make a PDF form read-only on the receiving terminate is to add a uncomplicated script to a push that volition be selected before submitting the form. This button can exist as simple every bit adding text such as "I concur that this information is correct" or fifty-fifty saying "past 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 job. The process listed below is to make all fields in the entire form read-only with one script.
The showtime step is to create a space on your form for the button with the text that y'all cull.
One time you set your "full general" options for your push button, become to "actions" and select "Mouse Up."

Add together The Following Script
Add together the post-obit code and choose "ok":
for (var i = 0 ; i < this.numFields ; i++) {
var f = this.getField(this.getNthFieldName(i)) ;
if (f.blazon != "push") // do I have to alter the word between " " with the name of my push button which I put on my PDF? name of button is "Valider"
{
f.readonly = true ;
}
}
Once y'all choose ok that screen will close, and you should now run into the added action in your action field.
At present You Need the Button to be Required
Save your PDF Interactive grade. You take at present created a button with a script to make the form 'read-only' earlier sending it to the targeted recipients.
For this to work finer, y'all need to brand 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.
Become dorsum to your button settings and choose the "full general" tab. Nether "common properties" check the box "required." Choose "shut," save your form over again and now the user must click that button to exist able to send the form. When they choose that required button the course will be inverse to a read-merely PDF.
Interactive PDF forms are a bang-up alternative to web forms, and can be used for a diverseness of projects. They are piece of cake 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 writer's knowledge. Content is for advisory or entertainment purposes merely and does non substitute for personal counsel or professional person communication in concern, financial, legal, or technical matters.
© 2012 dappledesigns
Le quan anh loc on September 28, 2018:
But later on 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 mail service this is very helpful.
Reina on June 29, 2018:
My class requires 4 signatures so I would similar my course to exist reviewed signed and forwarded to the next person. what do I add to exclude my signature, impress, salve and submit buttons?
By the fashion. Thanks for the JavaScript.
Tulasi on September 12, 2017:
Thank you for the explanation on how to make a fillable form read only. Can you allow me know how to create a pop up confirmation (OK or Abolish) that the user has done with his changes and wants information technology to be converted to read only format. When cancel is called to go back to class as fillable.
Vanessa on April 23, 2013:
Me again... I institute that this doesn't work after you enable usage rights... please help!
Vanessa on Apr 19, 2013:
Give thanks you give thanks y'all thank you... i've been searching for days through web pages and forums and no aid at all until I found your script! Works like a charm!
dappledesigns (author) from In Limbo between New England and the Midwest on April xiii, 2013:
@Eros - I think I sympathise at present what you are asking. By choosing the "read-only" push button, the script is initiated to run. Depending on the version of software, information technology will sometimes default to run when submitted. When you get in to set the "mouse up" options of the action on the button (the check marker to run the script) you lot should exist able to become in and cull when to run the action. For example, if yous choose for the script to run merely when the class is submitted, every bit opposed to when the box is checked. You lot can also choose to add a "reset" button on the course. In the reset options, you can have it reset all fields and scripts when used. This will clear all info already put in the grade, only it will release the script.
Eros on April 03, 2013:
farther to my previous mail service: the reason seems to be that fifty-fifty if the check marker is removed from the check box (which by the way needs to exist washed in editing mode since the script also turn the cheque box as read-only), the read-only condition is left on all of the other fields and if something needs to be revised, kickoff you lot need to remove the read-only mark in editing manner 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 sympathise what I want :)
Eros on Apr 03, 2013:
I still cannot go far work like would: I tin create the button with script which makes the grade read-but. But I cannot plow the certificate back to read-and-write, even if the push is unchecked / read-but check removed / entire button and script removed.
dappledesigns (author) from In Limbo between New England and the Midwest on April 01, 2013:
@Eros - just the user that filled out the form can change it back to revise. They can uncheck the required button and from in that location edit and resend. The recipient can non change the information.
@Pablo - I'm so glad you lot found it helpful!
Pablo on March 31, 2013:
Thank y'all very much!! I've been looking for a unproblematic script to lock pdf file for quite a while. This fits the bill exactly.
Eros on March nineteen, 2013:
This was very helpful, thanks. However, is in that location any way to turn the read-only form back to accessible, if something needs to revise etc.?
dappledesigns (writer) from In Limbo between New England and the Midwest on January 09, 2013:
Did you create the read-only push after the submit push button was created?
Carol on January 09, 2013:
This is helpful, thanks! However, when it turns into a read-merely form the Submit/Email push is deactivated too, and so the user can't submit the form. Whatever help with that would be appreciated.
Source: https://turbofuture.com/computers/How-to-Change-A-PDF-Form-to-Read-Only-Before-the-User-Submits
Posting Komentar untuk "Javascript Acrobat Set All Fields to Read Only"