Skip to main content
Inspiring
September 11, 2025
Question

Copying radio button status to another group

  • September 11, 2025
  • 1 reply
  • 128 views

Hi, I have two similar section in document with free text fields and radio group.

I have button (right-up corner) after mouse up copy free text fields from left section to right.

I want to copy status of checkboxes too, how to do this? Below screen and button script.

this.getField("Imię i nazwisko Ubezpieczonego I").value = this.getField("Imię i nazwisko Ubezpieczającego").value;
this.getField("Seria i numer dokumentu Ubezpieczonego I").value = this.getField("Seria i numer dokumentu Ubezpieczającego").value;
this.getField("Kraj urodzenia Ubezpieczonego I").value = this.getField("Kraj urodzenia Ubezpieczającego").value;
this.getField("Obywatelstwo Ubezpieczonego I").value = this.getField("Obywatelstwo Ubezpieczającego").value;

 

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
September 11, 2025

Should the checkboxes in the two groups always be in sync? If so, just use the same name for both groups. If you change one, then the ohter one will change as well. If you only want to set the 2nd group when the first one is selected, but allow the user to change the 2nd group, it gets a bit more complex. You would also have to deal with the situation that the user changes group 1, then modifies group 2 and then modifies group 1 again, which would override the changes that were applied to group 2 directly. 

 

Ignoring al that complexity, the easiest way to copy the selection of "Group1" to "Group2" (assuming that the export values for the radio buttons are identical) is to add the following as a "mouse up" script to each button in Group1:

// copy the value of group 1 to group 2
this.getField("Group2").value = event.target.value;
Inspiring
September 11, 2025

Thank you very much Karl!
As you said this situation is more complex 🙂

User must select only one option in Group1 and only one option in Group2.

Often responds are the same in both sections/groups (regards to the same peron, form is about to fill personal data). 
That is why button with data copying (text fields and group checkbox) is neccessary.

Have you some solution for that case?

Inspiring
September 11, 2025

BTW. This script in button not working

this.getField("Group2").value = this.getField("Group1").value;