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

Form Field Security

Community Beginner ,
Mar 09, 2018 Mar 09, 2018

Hello,

I need to make one form field editable by specific people, is there a way to apply a password to one form field in adobe acrobat? I have set up various form fields but the client needs to edit just the terms and conditions each time before sending out. So is there a way for only them to edit this section before sending out. I don't want recipients to be able to also edit the T&Cs. I've read about javascripts but this is going over my head! Or, is there a way to save out a read-only version from reader? I have Adobe Acrobat Pro DC but my client will only have Adobe Reader.

Hope that makes sense!

TOPICS
PDF forms
1.1K
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 09, 2018 Mar 09, 2018

Yes there is, but it's weak security, just meant to keep honest users honest.

Add a password text field. Put code in the validation script for this field that test's the password and enables the other fields if correct. At the end of the script set "event.rc=false", to cause the typed password to be removed.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 Beginner ,
Mar 12, 2018 Mar 12, 2018

Thanks Thom

I had a look and guess that I would place the script in the 'run custom validation script' box but do you know what the validation script would be? Also, I only need the one form field password protected, there are others that need to remain open.

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 12, 2018 Mar 12, 2018

You don't need a separate field, then. Just use this code as the field's custom validation script:

if (event.value) {

    event.rc = (app.response("Please enter the password:","","")=="1234");

}

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 12, 2018 Mar 12, 2018

Fields are enabled/disabled with the "field.readOnly" property.

So, here is more complete script for password protecting a field.

This script goes in the Validation Script of the password field

var bEnable = false;

if(event.value)

    bEnable = (app.response("Please enter the password:","","")=="1234");

}

this.getField("FieldToProtect").readonly = !bEnable;

event.value = false;

Readonly doesn't change the visual appearance of the filed. A more complicated enable/disable scheme for making the field look disabled is outlined here:

https://acrobatusers.com/tutorials/js_disabling_fields

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
LEGEND ,
Mar 12, 2018 Mar 12, 2018
LATEST

If the people you want to be able to edit specific fields will always login with the same user id, it is possible to use the JavaScript identity object to see if the user accessing the PDF form is one of the allowed user ids. This will require a special JavaScript folder be installed on the users's system.

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