Skip to main content
drslrb
Known Participant
July 24, 2024
Answered

Password protect form fields

  • July 24, 2024
  • 2 replies
  • 883 views

Hi. I have an adobe form with 2 password protected fields (Anesthesia provider and location).  When the pdf is opened in a browser instead of pdf reader, users can open the fields without a password.   I tried placing a field on top of the whole document that is visible when the document is opened in a browser to prevent interaction and hidden when it is opened in a pdf reader.  However, this isn't working to prevent being able to edit the 2 password protected fields without a password. 

 

Is there any way to prevent users from being able to open the 2 dropdown menus on the attached pdf unless a password is entered?

This topic has been closed for replies.
Correct answer try67

The fields are "password protected" using a script. If the viewer used does not execute scripts (at all, or correctly) this form of "protection" is useless. What you can do, though, is set them as hidden (or read-only) and put a button next to them. When the user clicks the button, the prompt appears and if the correct password is entered, the fields are made visible (or editable). That way, if scripts don't work in their viewer, they won't be able to fill in those fields.

But either way, you can't rely on this form of protection.

2 replies

PDF Automation Station
Community Expert
Community Expert
July 24, 2024

Instead of using buttons and covers, why not leave the dropdown entries empty and fill them with a script (setItems) after entering a password?  If the PDF viewer or web browser does not support the script, the user won't be able to see what's in the dropdown.  You can also test with the document is "external" (web browser) and execute a different alert if true, prompting the user to save and open with Adobe.  Here's an example of a script you could enter as a mouse down action in the dropdown:

if(this.external==true)
{app.alert("Please save this document and open it with an Adobe PDF viewer.",1)}
else
{
if(event.target.numItems<2)
{

var rtn=app.response("Password:");
if(rtn=="ABC")
{
event.target.setItems(["A","B","C"])
}
}
}

 

 

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 24, 2024

The fields are "password protected" using a script. If the viewer used does not execute scripts (at all, or correctly) this form of "protection" is useless. What you can do, though, is set them as hidden (or read-only) and put a button next to them. When the user clicks the button, the prompt appears and if the correct password is entered, the fields are made visible (or editable). That way, if scripts don't work in their viewer, they won't be able to fill in those fields.

But either way, you can't rely on this form of protection.