Skip to main content
Inspiring
August 16, 2023
Answered

Turn On "Select in Unison" for all Radio Buttons in a PDF

  • August 16, 2023
  • 2 replies
  • 807 views

Hi,

 

I have a large PDF form that has 400+ Radio Buttons. Many of these Radio Buttons are repeated and I want them to copy the prior selection. I know the property to turn on is "Buttons with the same name and choice are selected in unison". However, is there a way we can loop through the fields and turn this property on for all radio buttons in the PDF instead of going one-by-one or group-by-group?

 

Maybe something like how we change the mark type of a radio button:

this.getField().style = "styl.ch"

 

Any guidance would be appreciated, thank you!

This topic has been closed for replies.
Correct answer try67

this.getField("FieldName").radiosInUnison = true;

2 replies

Inspiring
August 16, 2023

For anyone else looking to do the same,

 

use this code:

 

for (var i = 0; i < this.numFields; i++) {
var Fld = this.getField(this.getNthFieldName(i));
if (Fld==null) continue;
if (Fld.type == "radiobutton") Fld.radiosInUnison = true;
}

try67
Community Expert
Community Expert
August 16, 2023

It should be done like this:

this.getField("FieldName").style = style.ch;

Inspiring
August 16, 2023

Thank you for your response. This code was just an example.

 

However, I am looking for a way to use JavaScript to turn on the "Buttons with the same name and choice are selected in unison" for all radio buttons in the document.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 16, 2023

this.getField("FieldName").radiosInUnison = true;