Skip to main content
Inspiring
August 16, 2023
Answered

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

  • August 16, 2023
  • 1 reply
  • 505 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 jasondimatteo

Figured it out with a little bit of help from try69 on another thread. Anyone else looking to do the same can 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;
}

1 reply

jasondimatteoAuthorCorrect answer
Inspiring
August 16, 2023

Figured it out with a little bit of help from try69 on another thread. Anyone else looking to do the same can 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's try67...