Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
8

Lock pdf form from editing, fields are editable but javascript code assigned to button will not work

New Here ,
Sep 24, 2023 Sep 24, 2023

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.

TOPICS
General troubleshooting , JavaScript , PDF forms
437
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 24, 2023 Sep 24, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2023 Sep 25, 2023
LATEST

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?

  

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2023 Sep 24, 2023

What scripts does you use at the two buttons?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2023 Sep 25, 2023

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines