Skip to main content
Participant
February 1, 2023
Answered

Click multiple radio buttons with a single button

  • February 1, 2023
  • 1 reply
  • 1630 views

I'm using Acrobat to build an interactive grading rubric. I feel good about what I have so far. Each grading criterion has three tiers, +4, +3, and +1. It's set up so the selected values will automatically add to the final score.

 

Now what I want to do is put in a button that will select all the +4 options. I've built a custom button that's labeled "Full Marks", but I need to know how to code it so it will select all the +4 radio buttons.

This topic has been closed for replies.
Correct answer Thom Parker

More specifics with an example:

Name: Intro Context

Button Style: Circle

Radio Button Choice: +4


When writing code, it is required to used exact values. So, so write the script you want, we have to know the exact names of the radio button groups and the exact export values. In one post you say the exports are (4,3,1) and in the next you say the export is "+4".  The export is a string value, not a number. So we have to know the exact text used.  For your calculations, the exports are converted to a number, but for checking a button, the string value is needed. 

 

For this example I'll assume that "+4" is the export value. 

 

Button Script:

 

this.getField("Intro Context").value = "+4";
this.getField("Thesis Concision").value = "+4";
this.getField("Thesis Position").value = "+4";
.. Repeat for other radio button fields...

 

 

That's it. It's pretty simple. 

 

1 reply

Thom Parker
Community Expert
Community Expert
February 2, 2023

Ok so how are the +4 radio buttons identified? For example, what are the names of the radio button groups that are involved?  What are the export values of the specific buttons?

 

You might find your answer here:

https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm

 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
February 2, 2023

Question groups are descriptive two-word phrases, describing the category and the specific criterion ithin that category (Thesis Concision, Thesis Position, etc). Individual buttons within each group are named by their point values and have apporpriate export values (4, 3, 1). I've managed to use them calculate the student's total score on sheet, so they're all functioning normally.

Participant
February 2, 2023

More specifics with an example:

Name: Intro Context

Button Style: Circle

Radio Button Choice: +4