FYI we are setting documentPrivilege.ChangeAllowLevel = 2 (not 1)
In the sample that you ran, none of the JavaScript would run at all, which is actually worse than what I am seeing. The file GP5124NM_ip.pdf is fully functional and shows how the final secured should behave. Textboxes are disabled when the document is opened and checking a checkbox will enable them. Entering a numeric value will cause the sum to update at the bottom.
Note that I am using JavaScript to disable certain textboxes when the document opens because when I did this server side, the OnLostFocus client side event would not fire (code to update the sum at the bottom). Everything is working fine, except after applying the security to the document, the code in the OnOpenPage event for each textbox does not work, and the textboxes are not being disabled when the document opens.
When I open the file in Adobe Acrobat Pro DC, the JavaScript debugger shows multiple errors such as:
NotAllowedError: Security settings prevent access to this property or method.
Field.readonly:2:Annot undefined:Open
The above errors are not happening for files that have not been secured. Somehow applying security is not allowing me to set the readonly property of the form fields.
I don’t care if this is done client side or server side. As I said above, setting the initial readonly value to true on the server resulted in other JavaScript not working correctly. Would really appreciated guidance here.
Thanks,
Bill