How to Open a Web Link Only When an Acrobat Checkbox is Checked
Question details
The user needs to configure a PDF checkbox so that a specific web link opens automatically only when the checkbox is selected, preventing the URL from launching when the user clears the checkbox.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating interactive PDF forms where checking a box triggers an external website to open.
- Observed behavior
- Using standard link actions causes the web link to trigger on any interaction, meaning it launches both when checking and unchecking the box.
Ensure you have Adobe Acrobat Pro or an advanced PDF editor installed, as basic PDF readers do not support creating form fields or adding custom JavaScript actions.
Use Mouse Up JavaScript in Acrobat to Trigger the Web Link
Apply a simple JavaScript condition to the checkbox's Mouse Up action to verify its state before launching the target URL.
To prevent the link from opening when the box is unchecked, you must avoid the standard 'Open a web link' action. Instead, you can use Acrobat's built-in JavaScript engine to check if the value of the checkbox is not 'Off' before executing the link.
Open your PDF document in Adobe Acrobat. Go to the 'Tools' menu and select 'Prepare Form' to enable form editing.
Right-click the specific checkbox you want to configure and select 'Properties' from the context menu.
Navigate to the 'Actions' tab. From the 'Select Trigger' dropdown, choose 'Mouse Up'. From the 'Select Action' dropdown, choose 'Run a JavaScript', then click the 'Add' button.
In the JavaScript Editor window, paste the following code: if (event.target.value != "Off") app.launchURL("https://www.example.com"); Replace the example URL with your desired destination. Click 'OK' to save.
Click 'Close' on the Properties dialog. Exit the Prepare Form mode by clicking 'Close' at the top right, then click the checkbox to verify the web link only opens when it transitions to the checked state.

Manage PDFs and Add Hyperlinks Effortlessly with WPS Office
While advanced form JavaScript requires specialized setup, WPS Office provides a robust, user-friendly PDF Editor that makes it easy to add interactive web links, edit text, and fill out forms directly.
- 1. Open Your PDF: Launch WPS Office and open your target PDF file.
- 2. Access the Link Tool: Navigate to the 'Edit' tab on the top ribbon menu and click on the 'Link' button.
- 3. Insert Web Link: Draw a rectangle over the desired interactive area, select 'Open a web link', and enter your URL destination to instantly create a clickable link.

Frequently Asked Questions
Why does my web link open when I uncheck the PDF checkbox?
If you use the standard 'Open a web link' action in the Actions tab, Acrobat applies the trigger to any interaction with the checkbox. Unchecking is considered an interaction, which triggers the URL. Using JavaScript allows you to specify that the link should only open if the checkbox state is active.
What does the 'Off' value mean in the JavaScript snippet?
In Adobe Acrobat forms, 'Off' is the default export value for a checkbox when it is cleared or unselected. By checking if the value is not equal to 'Off' (event.target.value != "Off"), the script ensures the action only runs when the box is checked.
Will this JavaScript action work on mobile PDF readers?
Most mobile PDF viewers have limited or no support for JavaScript. The conditional checkbox link will work reliably on desktop applications like Adobe Acrobat or Foxit Reader, but it may fail to trigger on default iOS or Android PDF viewers.
Can I use this method to open multiple web links at once?
Yes, you can add multiple app.launchURL() commands within the same 'if' statement in your JavaScript snippet to open multiple tabs, though modern web browsers may block subsequent links as pop-ups.




