Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to restrict editing on one field specifically (editable form)

Explorer ,
Mar 03, 2022 Mar 03, 2022

Hi, I am working on a PDF certificate for a course with multiple sessions. I am looking for a way to send a template to the instructor where he can select the course end/certification date and then lock that specific field (so students cannot edit the date and say they were recertified). The only other field is where course participants will write thier name - that needs to remain editable. Pretty much I need the insturctor and only the instructor, to edit the date, and the participants will only have the ability to write their name.

 

This will be downloaded for students to edit, not sent through Adobe Sign as it will add restrictions after "signed" and he would need mulitple copies for each student (hundreds) and send each one individually via email (a headache). 

 

I know you can add restrictions and make the document as a whole not editable, but is there a way to restrict editing on a specific field? (please tell me there is! I have tried locking the field but that just locks it in place)

TOPICS
Create PDFs , General troubleshooting , How to , PDF forms
4.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Mar 03, 2022 Mar 03, 2022
LATEST

The most simple way is to set the field as read-only. It's far from secure, but will work in most cases (especially if the students only have the free Reader). If you want it really secured then you need to digitally sign the file, locking those fields and leaving the others editable.

 

For the former, you can use a simple script. For example, if you add a button to lock those fields you can use this code as its MouseUp event:

 

var fieldsToLock = ["Name", "Date"]; // enter actual field names here
for (var i in fieldsToLock) {
	var f = this.getField(fieldsToLock[i]);
	f.readonly = true;
	f.defaultValue = f.valueAsString; // this will prevent the values from being cleared if the form is reset. Remove this line if you do want that to happen.
}
event.target.display = display.hidden; // hides the button itself

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 03, 2022 Mar 03, 2022
LATEST

The most simple way is to set the field as read-only. It's far from secure, but will work in most cases (especially if the students only have the free Reader). If you want it really secured then you need to digitally sign the file, locking those fields and leaving the others editable.

 

For the former, you can use a simple script. For example, if you add a button to lock those fields you can use this code as its MouseUp event:

 

var fieldsToLock = ["Name", "Date"]; // enter actual field names here
for (var i in fieldsToLock) {
	var f = this.getField(fieldsToLock[i]);
	f.readonly = true;
	f.defaultValue = f.valueAsString; // this will prevent the values from being cleared if the form is reset. Remove this line if you do want that to happen.
}
event.target.display = display.hidden; // hides the button itself
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines