Check Box = a value but only one box in a group can be checked

New Here ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

Checkboxes - Exceed2, Exceed5, Exceed6

Text Fields - Exceed Count 2, Exceed Count 5, Exceed Count 6

 

I have a column for an employee performance documents with 3 rows of items (Exceed2, Exceed5, Exceed6).  Each row has a checkbox, that if it is checked it will give the corresponding textbox beside it a value of 2.  If unchecked it will be blank.  I have gotten this to work using the custom calculation script.  This is the formula I used.

 

if (this.getField("Exceed2").isBoxChecked(0))
event.value = 2;
else
event.value = "";

 

 

My issue is I only want one of the checkboxes to be able to be checked at a time.  Is this possible?  If not, is it with radio buttons?  

TOPICS
Acrobat SDK and JavaScript

Views

44

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
Adobe Community Professional ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

It's possible, give all 3 checkboxes same name but give them different export value.

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
Adobe Community Professional ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

LATEST

Read this primer on Checkboxes/radiobuttons in Acrobat:

https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm

 

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