How to Allow Only One Check Box Selection per Question in PDF Forms
Question details
The user needs to configure a PDF form quiz where each question has five independently named check boxes, but only one option can be selected at a time.

- Product
- PDF Editors
- Device & OS
- not provided
- Scenario
- Creating an accessible PDF form quiz where options have different values and tooltips, and checked boxes are tallied at the end for custom score calculation.
- Observed behavior
- Currently, the check boxes function independently, allowing multiple selections per question. The goal is to enforce mutual exclusivity while maintaining independent export values and tooltips.
Ensure you have a PDF editing tool that supports custom JavaScript actions for form fields and that your check boxes are clearly named (e.g., Q1_1, Q1_2, Q1_3).
Use JavaScript MouseUp Actions to Enforce Single Selection
Add a custom script to each check box that clears the other fields in the group when clicked.
By using a MouseUp action script, you can simulate radio button behavior on independently named check boxes. This allows you to retain individual tooltips and diverse export values for final score tallies.
Open your PDF form in editing mode and right-click the first check box (e.g., Q1_1) to access its Properties.
Navigate to the 'Actions' tab, select 'Mouse Up' as the trigger, and choose 'Run a JavaScript' as the action.
Enter the script to clear the other options: if (event.target.value != "Off") this.resetForm(["Q1_2", "Q1_3", "Q1_4", "Q1_5"]);
In the 'Options' tab, assign a unique export value for the check box so that the final scores can be tallied correctly at the end of the form.
Repeat this process for the remaining check boxes in the group, updating the script array to exclude the current check box you are editing.

Alternative: Use Radio Buttons Instead of Check Boxes
If custom JavaScript is too complex, standard radio buttons naturally enforce single-choice selection.
Easily Edit and Manage Interactive PDF Forms with WPS Office
WPS Office provides robust PDF editing capabilities, allowing you to insert, modify, and configure interactive form elements like check boxes, radio buttons, and properties with ease.
- 1. Open Your PDF: Open WPS Office and load your PDF document.
- 2. Access Form Tools: Navigate to the 'Form' tab to access interactive field tools.
- 3. Insert Form Fields: Click 'Check Box' or 'Radio Button' to insert choices into your quiz.
- 4. Configure Properties: Double-click the inserted field to open Properties and adjust export values or interactions.

Frequently Asked Questions
Why use check boxes instead of radio buttons for single-choice questions?
While radio buttons natively force a single selection, using independent check boxes allows each option to have unique tooltips, custom names, and specialized JavaScript calculations, which is highly beneficial for complex and accessible forms.
How do I calculate the total score from selected check boxes in a PDF?
You can assign specific export values to each check box in the Options tab. Then, add a text field at the end of the form, and under its Calculate properties, use a script to sum up the values of the checked boxes.
Will JavaScript actions work in all PDF readers?
Basic JavaScript like `this.resetForm()` works in most standard desktop PDF readers like WPS Office and Adobe Acrobat. However, some mobile PDF viewers or web browsers might not fully support interactive form scripts.




