Skip to main content
William225192357fw1
Inspiring
Jan 5, 2022 5:58 PM UTC
Question

Calculating check boxes passing a value to calculate a %

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 is closed to new replies. Start a new post to keep the conversation going.

8 replies

Inspiring
Jan 6, 2022 2:03 PM UTC

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.

Translate
William225192357fw1
Inspiring
Jan 6, 2022 5:05 PM UTC

Let me check this out, thank you!

Translate
William225192357fw1
Inspiring
Jan 6, 2022 5:33 PM UTC

Adding this in for assistance

Translate