Lock pdf form from editing, fields are editable but javascript code assigned to button will not work
Copy link to clipboard
Copied
I have created a pdf form document, with the normal textfields etc and everything is all good on that side there is also a couple of buttons which have actions to run a javascript, these run fine in the unlocked version however when I lock for editing allowing form fields to be completed etc everything works even the print and reset buttons however the two buttons I have that execute javascript are not working as expected in fact they do nothing at all. Any suggestions would be greatly appreciated.. I have the javascript enabled from within the menu as mentioned it runs fine when not locked with the password.
Copy link to clipboard
Copied
on the javascript debugger i get the following:
NotAllowedError: Security settings prevent access to this property or method.
Doc.addField:163:Field btnRUAdd:Mouse Up
Copy link to clipboard
Copied
Is it really necessary for the script to use the addField() function? Could you place these fields on the form and hide them until needed?
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
What scripts does you use at the two buttons?
Copy link to clipboard
Copied
If you encrypt the file (which is what I understand you mean) and only allow filling-in form fields, that doesn't allow adding new fields (using a script or manually), as it's a form of editing.

