Check all checkbox code

New Here ,
Feb 06, 2018 Feb 06, 2018

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

98

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Feb 06, 2018 Feb 06, 2018
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 scriptthis.getField("Group1").getArray().forEach(function(a){a.value = "Yes";});

Likes

Translate

Translate
Adobe Community Professional ,
Feb 06, 2018 Feb 06, 2018

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";});

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

LATEST

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines