Skip to main content
Participant
December 14, 2023
Answered

If radio button is selected No = the rest of the point turn to 0

  • December 14, 2023
  • 1 reply
  • 206 views

I'm trying to figure out how to make the Points column turn to 0 if Group 1 or Group 2 radio button No is selected. Since No is an automatic fail of 0 even if the other radio buttons are selected throughout the questionnaire the points should show 0. I have values already in place for each Group. And the properties are only allowing me to go so far with Sums and I'm terrible at Javascript. Any suggestions would be appreciated.

 

This topic has been closed for replies.
Correct answer Nesa Nurani

You can use something like this:

var g1 = this.getField("Group1").valueAsString;
var g2 = this.getField("Group2").valueAsString;

if(g1 == "No" || g2 == "No")
event.value = 0;
else{
//put script to calculate rest of the points here
}

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
December 14, 2023

You can use something like this:

var g1 = this.getField("Group1").valueAsString;
var g2 = this.getField("Group2").valueAsString;

if(g1 == "No" || g2 == "No")
event.value = 0;
else{
//put script to calculate rest of the points here
}