Trying to count total number of radio buttons selected with different values
I have multiple questions with 5 radio buttons valued from 1-5. I am trying to have a textbox calculate the total number of 4's and 5's that were selected out of all questions.
I am able to calculate all of the 4's using this below. any suggestions on how to add the 5's to get the total of both columns?
var testFor = "4";
var groups = this.getField("Group");
var ar = groups.getArray();
var cnt = 0;
for (var i=0; i<ar.length; i++) {
if (ar[i].value == testFor) {
cnt++;
}
}
event.value = cnt;
