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

Javascript popup if checkbox is checked using radio button

New Here ,
Dec 19, 2019 Dec 19, 2019

I am looking for a javascript to cause a popup info box IF a checkbox from a radio button is selected.

 

I have a section PDF form that involves how an employee was transported to get medical care. They are given 3 options.

 

There are 3 radio buttons that correspond with this section

The first one is ambulance,

second is personal auto,

third is employee transported.

 

If the person filling this form selects the ambulance option, I want a box to pop up that states "You must contact HR Department @ ###-###-#### immediately"

 

The box should have an option to click "OK" and an "X" button to close the window. Please help! 

 

I do not want the javascript to happen if the other two options are selected, only the "ambulance" option.

Thank you

TOPICS
General troubleshooting
2.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
1 ACCEPTED SOLUTION
Community Expert ,
Dec 19, 2019 Dec 19, 2019

Here is an article on the topic, and it even has a sample file linked at the bottom

https://acrobatusers.com/tutorials/popup_windows_part1

 

 

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

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 ,
Dec 19, 2019 Dec 19, 2019

Here is an article on the topic, and it even has a sample file linked at the bottom

https://acrobatusers.com/tutorials/popup_windows_part1

 

 

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 ,
Dec 19, 2019 Dec 19, 2019
LATEST

You can use this code as the Mouse Up script of your radio-button fields:

 

if (event.target.value=="ambulance") app.alert("You must contact HR Department @ ###-###-#### immediately",3);

 

There's no "X" button to close the dialog, though, just an OK button.

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