Skip to main content
Participant
February 2, 2024
Question

Counting ticked checkboes

  • February 2, 2024
  • 1 reply
  • 261 views

I am trying to figure out how to have my fillable PDF count how many check boxes are ticked off.

There are a lot and already have scipt for calculation totals based on indivdual values already assigned...

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
February 2, 2024

You didn't give us enough info to go with. Let's say you have named your checkboxes in sequence,

Check Box1-5 for example, you can use this custom calculation script in a text field to count how many checkboxes are checked:

 

var Checked = 0;
for(var i=1; i<=5; i++){
var check = this.getField("Check Box"+i).valueAsString;
if(check !== "Off")Checked++;}
event.value = Checked;