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

Javascript not working in Adobe Reader

Community Beginner ,
Aug 22, 2024 Aug 22, 2024

I have created a form with checkboxes that when selected spawn a page at the end of the form and removes the page if unchecked. The script works great for me when I am using it in Acrobat Pro but when sent to the user, the script won't function in Adobe Reader. Here is a sample of the script I have for each check box:

if(event.target.value!="Off")
{this.getTemplate("Template Name" ).hidden=false;}
else
{this.getTemplate("Template Name" ).hidden=true;}

 

Is there anything I can change or re-work to get the pages to spawn and delete as needed for the user? I am a complete novice at this.

TOPICS
How to , JavaScript
1.3K
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
2 ACCEPTED SOLUTIONS
Community Expert ,
Aug 22, 2024 Aug 22, 2024

Your script doesn't spawn or delete pages.

Acrobat Reader can't show or hide pages.

View solution in original post

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 Beginner ,
Aug 27, 2024 Aug 27, 2024
LATEST

Thank you so much! I was able to amend this to what I needed and it worked perfectly.

View solution in original post

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 ,
Aug 22, 2024 Aug 22, 2024

Your script doesn't spawn or delete pages.

Acrobat Reader can't show or hide pages.

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 ,
Aug 22, 2024 Aug 22, 2024

Use spawn method instead, something like this:

var t1 = this.getTemplate("Template Name");
if (event.target.value != "Off"){
t1.spawn({nPage: numPages, bRename: false, bOverlay: false});}

 

Also, you can't hide template, you need to delete page using this.deletePages(), keep track of where you spawn template and delete that page.

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 ,
Aug 22, 2024 Aug 22, 2024
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 Beginner ,
Aug 27, 2024 Aug 27, 2024
LATEST

Thank you so much! I was able to amend this to what I needed and it worked perfectly.

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