Copy link to clipboard
Copied
I am playing around with an inspection form and am trying to decide if radio buttons or check boxes are the better option. I am trying to program if then statements for checkboxes so that when a checkbox is selected, a point value is displayed in a specific text box. I learned how to accomplish this with radio buttons so I am hoping the philosophy is similar for checkboxes. Below is what I am trying to do. The code is accepted in the PDF form but nothing is being populated. Any help is much appreciated.
event.value = "";
if (N/ACheckBox.isSelected()){
event.value = 1;
} if (GreenCheckBox.isSelected()){
event.value = 1;
} if (AmberCheckBox.isSelected()){
event.value = .5;
} if (RedCheckBox.isSelected()){
event.value = 0;
}
I am hoping that the point value will disappear if the statements are false too.
Copy link to clipboard
Copied
- That's not how you access a field in Acrobat JS.
- There's no such method as "isSelected".
Change this (and all other similar lines):
if (N/ACheckBox.isSelected()){
To:
if (this.getField("N/ACheckBox").isBoxChecked(0)){
Copy link to clipboard
Copied
- That's not how you access a field in Acrobat JS.
- There's no such method as "isSelected".
Change this (and all other similar lines):
if (N/ACheckBox.isSelected()){
To:
if (this.getField("N/ACheckBox").isBoxChecked(0)){
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied