Skip to main content
Participant
September 20, 2023
Question

Script to list dropdown responses

  • September 20, 2023
  • 1 reply
  • 386 views

I have a questionaire with drop down boxes with Y or N  option for each question

 

Looking to produce CSV text Y =1 N=O to list responses once selected 

trying this below but doesnt work as intended. Any help would be appreciated. 

 

event.value = "";
var a = this.getField("dropdown1").value;

if(a != "Y"){
event.value = "1, ";
}

else if(a != "N"){
event.value = "0, ";
}
var b = this.getField("dropdown2").value;

if(b != "Y"){
event.value += "1, ";
}
else if(b != "N"){
event.value = "0, ";
}

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 20, 2023

In the last condition you should use

event.value +="0, "

instead of

event.value ="0, "

as that will overwrite any previous values you applied.