These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to set password on selected fields in acrobat?

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18

Hello Everyone
 
Anyone know how to set password or protect specific fields in the form.
 
For example:
 
If i've an appraisal form and it's contains deferent fields some of them for an employees and other for Supervisors. So i want to distribute the form to our staff. But i don't want employees can write on the Supervisor field and if they try that the acrobat asked them a password.
  
Hope some one can help me ASAP.
  
Sincerely,,

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

My Product Information:
Acrobat Pro Extended, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
There's no built-in feature to do that, but I've come up with some rudimentary code to achieve it (although it's far from secure). Use this as your text field's OnBlur event (you can change the password, if you wish):

if (event.value!="") {
resp = app.response("Enter the password:");
if (resp==null || resp!="123") event.target.value="";
}

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
Thank you very much sir for your quick response, but would you please explain more bcoz i'm beginner in JavaScript.

Just tell me the steps for adding the codes kindly, and where should i add them in acrobat?!!

Your cooperation is highly appreciated .


Regards,,

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
please tell me what is the best book for learning javascrip for acrobat.

Thanks

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Go to your field's Properties, Actions tab, add a new OnBlur Action, select Execute JavaScript and paste the code into the window. In this sample code the correct password is "123". You can adjust that if you wish (but don't remove the double-quotes).

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
I'm sorry! sir it doesn't work with me :(

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

try67
Expert
Registered: Oct 30 2008
Posts: 2398
I can't help you if you don't provide more information. What does "doesn't work" mean?
Are there error messages in the console (Ctrl+J)?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
But when i past the code in Validate field it's almost work when i write something inside field and i click out of the field then javascrip ask me to enter password .

but this is not what i need .

i need when the employees try to click inside the field to write something then javascript ask them to enter the password.


Please help sir,,


Thanks for all your efforts

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

try67
Expert
Registered: Oct 30 2008
Posts: 2398
First of all, I didn't say anything about the Validate event.

To achieve that you need to create a field to switch to in case the user enters the wrong password. Let's say it's called "outside". Then you enter this code as the On Focus action of your protected field (I've moved the correct password to the first line of the code in this one):

var correctPassword = "123";
resp = app.response("Enter the password:");
if (resp==null || resp!=correctPassword) getField("outside").setFocus();

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
Thank you very much sir i'm sorry if i make you tired.

it's clear now and i do really appreciate your help


have a nice day :)

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
sorry one more thing what if there's a hidden field and i want it to be visible by manager only through a password is it possible sir?

thanks

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

try67
Expert
Registered: Oct 30 2008
Posts: 2398
How should it be triggered?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
i mean i've an appraisal form contains on 25 topic as following for example:

1- Performance 5. 4. 3. 2. 1. 0. NA.
2- Attendance 5. 4. 3. 2. 1. 0. NA.
3- ....
4- ....
Until 25-

the end of form there is a result from these points 5. 4. 3. ...etc.

my question is i already did how to + the points in specific field but i want to protect this field as following method:

-When the employee try to show the result from the specific field it's ask him to enter password to show the result that already calculated but already hidden.


Hope you could understand me because my English isn't much good.


Thanks a lot for your help sir.


Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
So! No solutions for this ??

thanks

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.

Ahmed Hadi
Registered: Jun 12 2011
Posts: 18
Dears ,,

How can i set a password in PDF. file, But i want to make it active after 15 day, i mean after i set the password i can open the file normaly until 15 days, after that when i try to open it. it's require a password.

Please help me ASAP.

Thanks,,

Sincerely yours,,,

Ahmed Hadi
Executive Admin in IT Company.