Skip to main content
William225192357fw1
Inspiring
January 5, 2022
Question

Calculating check boxes passing a value to calculate a %

  • January 5, 2022
  • 1 reply
  • 1470 views

What our team would like to do here:
A user chooses if they Have or Need to Develop a skill. Each H chosen passes a 0. Each D chosen passes a 1 and calculates the % total. 0/33/66/100 is possible. Each H and D need a different box name, like Have1 and Develop1 and so on through possibly 300 skill levels. 

It seems something along the lines of:

var total = 0;
for (var i=1; i<=1; i++) {
var f = this.getField("Check Box"+i);
if (f.valueAsString=="1") total++;
}

event.value = total;

 

should be a starting place, but I don't think it's that simple. We don't want to have to use the Pick option in Calculate. Thoughts anyone?

Thanks!

This topic has been closed for replies.

1 reply

Inspiring
January 6, 2022

The checkbox names should be equal, because otherwise the checkboxes can be chosen simultaniously.

You can give them different values when checked however, see the example attached for a rough example of what you're looking for.

William225192357fw1
Inspiring
January 6, 2022

Let me check this out, thank you!

William225192357fw1
Inspiring
January 6, 2022

Adding this in for assistance