Copy link to clipboard
Copied
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.getField("FieldName").radiosInUnison = true;
Copy link to clipboard
Copied
It should be done like this:
this.getField("FieldName").style = style.ch;
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
this.getField("FieldName").radiosInUnison = true;
Copy link to clipboard
Copied
Thank you, this worked like a charm!
Copy link to clipboard
Copied
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;
}