As far as i know, this is not possible.
You can view all the password options in File > Form Properties > PDF
It is possible, but involves a fair bit of scripting bringing together solutions from Paul Guerette (lock all fields) and Dimosthenis Theodoridis (article on Generating and working with hashes in dynamic PDF forms) and an AcroDialog (from Windjack solutions) to create a nice dialogue window to bring it all together to the user.
Basic approach would be to have a function to lock the selected subforms/fields. Then declare global variables in the File / Form properties / Variables tab for usernames and/or passwords. Use Dimosthenis's solution to generate SHA-256 hash strings for each password and then this is what you use in the global variable. When the user inputs their password, the script would first convert it to a SHA-256 hash string and compare it with the global variable, if it matches it would run an unlock fields function.
It can be done, but it is involved - it just depends if it is worth the effort for your application.
Thanks Niall. Good to know this is actually possible.
For what it is worth:
I regularly hide a subform that I call a "Control Panel". It allows administration of the form using AdobeReader--a user/admin with the right combination of arbitrary information entered into 3 fields already present on the form, can unlock (or reveal) the control panel. Once inside, there are tables to allow changes to product pricing, product descriptions, even administrate password info for a second admin. Also inside, there is a button to close it. Once closed and saved, the form is ready to be used with the updated information. Simple.
Granted, this may not offer the level of security needed. It isn't incrypted. However, there is asolutely no evidence that it exists, so it is unlikely to be subject to hacking efforts. And, for my needs, it is not critical that the security be absolutely, 100% bullet-proof. It is not widely distributed and the limited negative consequences of a breach don't merit extra efforts in securing it.
I like it - nice, clean and easy to implement!!
I like also but still don't understand exactly. Would you care to explain a little more? I am still new to scripting especially buttons.
Here is an example. I can relate to being a beginner--not being a programmer myself.
Follow the instructions on the form to reveal the "Secret Space". I don't know if this will help you, since it is not clear to me what you are attempting to conceal.
If you want to conceal some of what the user has entered, you could have the "Subform" open when the form opens, and then when the user is done entering what needs to be hidden, click a button that hides the "Subform". Then only the Admin could reveal it again, by using the same technique demonstarted in the attached example.
Hope this helps.
SecretSpaceExample.pdf 146.0 K