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

JavaScript

Community Beginner ,
Mar 25, 2024 Mar 25, 2024

Hi! I am working on a project in Acrobat Pro. I need a button to show a layer if two other text field entries don't match. So, basically - On click if text field 1 does not equal text field 2 then show layer "Alert" 

I am thinking it can be done using JavaScript, I just don't know how to write it.

TOPICS
JavaScript
399
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
Adobe Employee ,
Mar 25, 2024 Mar 25, 2024

Hi @jamiep59794486 

Hope you are doing well and thanks for reaching out.

The workflow you are trying to achieve is might be possible using JavaScript. For more information, please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html

Hope it will help

Regards
Amal

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 ,
Mar 25, 2024 Mar 25, 2024

See this article:

https://acrobatusers.com/tutorials/create_use_layers/

 

 

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 Beginner ,
Mar 25, 2024 Mar 25, 2024

Thanks. I understand how to make a layer - I currently have the layer on the page. I have a button that when clicked will show or hide it. I need to add conditions that when that button is pushed if text field 1's contents do not equal text field 2's contents then show layer "Alert" - that is why I think I need a javascript.

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 ,
Mar 25, 2024 Mar 25, 2024

The article explains how to use JavaScript to show/hide layers. 

To add conditions to the script, read this article.

https://www.pdfscripting.com/public/How-to-write-an-If-statement.cfm?sd=40

 

 

 

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 Beginner ,
Mar 25, 2024 Mar 25, 2024
LATEST

Thanks, I will check it out. Giving myself a "brain break" for the day. Will try it tomorrow morning and let you know.

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