How to Select Checkboxes Based on Text Field Ranges in Adobe Acrobat
Question details
The user needs a method to automatically select specific checkboxes in a PDF form based on the numeric values entered into a text field.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Designing a dynamic interactive PDF form where checkboxes must respond to defined ranges (e.g., 1-5, 6-32) entered into a corresponding text field.
- Observed behavior
- The checkboxes need to toggle to their 'Yes' export state when the inputted text matches their assigned numeric range and revert to 'Off' when the field is empty or out of range.
Verify the exact names and export values of your checkboxes in the PDF form properties, as the JavaScript validation script relies on accurate field mapping to function properly.
Apply Custom JavaScript for Multiple Checkboxes
Use a custom JavaScript validation script on the text field to automatically toggle specific checkboxes based on the exact numeric input.
By applying a custom validation script to the source text field, Adobe Acrobat can evaluate the input value dynamically. The script retrieves the value upon entry and assigns a checked ('Yes') or unchecked ('Off') state to target checkboxes via their field names.
Open your document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form' to enable form field editing.
Right-click the text field where users will enter the numeric ranges and select 'Properties' from the context menu.
Go to the 'Validate' tab, choose 'Run custom validation script', and click the 'Edit' button.
Paste the following evaluation logic: this.getField('1').value = event.value == 1 ? 'Yes' : 'Off'; Repeat this for values 2 through 5. For the range 6 to 32, use: this.getField('6').value = (event.value >= 6) && (event.value <= 32) ? 'Yes' : 'Off';
Click 'OK' to save the script, close the properties window, and test your form by entering numbers in the text field to observe the checkboxes.

Validate a Single Dynamic Checkbox
If you are passing variable data to a single checkbox rather than toggling multiple individual boxes, adapt the script to evaluate and cap the input.
Create and Manage Fillable PDF Forms with WPS Office
WPS Office provides a highly compatible PDF editor that allows you to seamlessly design interactive forms, insert checkboxes, and manage text fields without complex software configurations.
- 1. Launch WPS PDF: Open WPS Office and select the PDF module to load your document.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to view all interactive control options.
- 3. Insert Checkboxes and Fields: Select 'Check Box' or 'Text Field' and click on the page to place them. Double-click the fields to adjust their properties and export values.
- 4. Save and Distribute: Once your fillable form is organized, save the PDF to easily share it for data collection.

Frequently Asked Questions
Why aren't my Acrobat checkboxes updating when I type in the text field?
Ensure your JavaScript validation script is applied directly to the text field's 'Validate' tab, not the checkbox itself. Additionally, verify that the field names referenced in your script accurately match the names of the checkboxes in your document.
What is the default export value for checkboxes in Adobe Acrobat?
By default, the export value for a checked box in Acrobat is 'Yes'. If you changed this value during the creation of your form, you must update your JavaScript to use that custom string instead of 'Yes'.
How do I clear checkboxes when the text field is empty?
Your JavaScript condition must account for an empty string or values outside the designated range. Using a ternary operator like `event.value == 1 ? 'Yes' : 'Off'` automatically assigns the 'Off' state (clearing the checkbox) if the condition is not met.




