How to Display Different Values from PDF Form Checkboxes
Question details
The user wants a specific text field in an interactive PDF form to dynamically display different numerical amounts based on which of three checkboxes is selected.

- Product
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form that uses conditional logic to evaluate checkbox selections and assign specific values to a text field.
- Observed behavior
- The goal is to automatically output 449 for EBM1, 549 for M1, and 849 for NM1 into a target text box, while ensuring mutually exclusive selections if only one amount should be applied at a time.
Ensure your PDF editing software supports advanced form field properties and custom JavaScript calculations. If users should only be able to select one option at a time, consider configuring your checkboxes to be mutually exclusive or using a radio button group instead.
Use a Custom JavaScript Calculation Action
Apply a custom JavaScript snippet to the text field's calculation properties to check the state of each checkbox and output the corresponding value.
By utilizing a custom calculation script in your PDF form, you can evaluate which checkbox is currently ticked and assign the corresponding numerical value directly into a text field. This is the most reliable method for conditional outputs.
Open your PDF form editor, right-click the target Text Field where you want the value to appear, and select Properties.
In the Properties dialog box, go to the Calculate tab and choose the option for 'Custom calculation script'.
Click Edit to enter your script. Write logic to check the checkbox states, for example: if (this.getField("EBM1").value !== "Off") event.value = 449; else if (this.getField("M1").value !== "Off") event.value = 549; else if (this.getField("NM1").value !== "Off") event.value = 849; else event.value = "";
Click OK to save the script, close the properties window, and test your document by clicking the different checkboxes to see the text field update dynamically.

Create and Manage Advanced PDF Forms with WPS Office
WPS Office provides robust PDF editing capabilities, including the ability to create interactive forms with checkboxes, text fields, and advanced properties. It allows you to build professional documents without complex software overhead.
- 1. Open your PDF in WPS Office: Launch WPS Office and open the PDF document you want to edit.
- 2. Access the Form Tools: Navigate to the Form tab on the top ribbon to insert Checkboxes, Radio Buttons, or Text Fields.
- 3. Configure Form Properties: Double-click the newly inserted form field to access its Properties and configure its name, appearance, or specific calculation values.
- 4. Save Your Document: Once your interactive fields are set up, save the PDF form to share with your clients or colleagues.

Frequently Asked Questions
Can I use Radio Buttons instead of Checkboxes for this scenario?
Yes. Radio Buttons are specifically designed for mutually exclusive choices. By grouping them with the exact same field name and assigning different export values (e.g., 449, 549, and 849), the text field can simply be set to calculate or display the value of the radio button group without complex JavaScript.
Why isn't my text field updating when I click the checkbox?
The text field might not calculate immediately if the form's calculation order is incorrect, or if a trigger event is missing. Ensure your calculation script is error-free and applied directly to the text field's Calculate tab, not the checkbox itself.
Are custom calculation scripts supported in all PDF readers?
Most modern desktop PDF readers, including WPS Office and Adobe Acrobat, fully support standard JavaScript calculations in interactive forms. However, some basic mobile PDF viewers or web browser extensions might lack full JavaScript support, causing calculations to fail.




