Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now