Copy link to clipboard
Copied
Hi all,
I'm a coding noob and can do basic stuff but I can not for the life of me figure out how to code a check box (checkall) to select yes on 20 or so radio buttons (radio1-20)for marking rather than having to select each one. But I still need to be able to change some individual radio buttons to no and if unselected clear all radiobox if required. Can someone point me in the right direction. I assume I need to create an array and code on a mouse up for the check box. Just not sure how to proceed.
Use a button Mouse Up Script. The easiest solution is to prefix all the radio button names with something like "Group1.". The "dot" at the end is critical. This groups the fields so they can be handled as a group. Next, make sure all the Yes buttons have an export value of "Yes". Now put this code in the button script
this.getField("Group1").getArray().forEach(function(a){a.value = "Yes";});
Copy link to clipboard
Copied
Use a button Mouse Up Script. The easiest solution is to prefix all the radio button names with something like "Group1.". The "dot" at the end is critical. This groups the fields so they can be handled as a group. Next, make sure all the Yes buttons have an export value of "Yes". Now put this code in the button script
this.getField("Group1").getArray().forEach(function(a){a.value = "Yes";});
Copy link to clipboard
Copied
Thank you!