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?
Copy link to clipboard
Copied
It's possible, give all 3 checkboxes same name but give them different export value.
Copy link to clipboard
Copied
Read this primer on Checkboxes/radiobuttons in Acrobat:
https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm
Copy link to clipboard
Copied
++ Adding to the discussion
In this scenario, if you want to be able to check one at a time, I would preffer better to use mutually exclusive radio buttons but with the same export value of "2" on each one, and then employ an action script for each of the radio button that corresponds to the desired Exceed2, Exceed5, Exceed6 text fields respectively.
I would add a script to each radio button as shown below:
// script for the radio butron next to Exceed2 field
if (event.target.value=="Off"){
this.getField("Exceed2").value ="";
} else {
this.getField("Exceed2").value = event.target.value;
this.getField("Exceed5").value = "";
this.getField("Exceed6").value = "";
}