Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
3

Script to list dropdown responses

New Here ,
Sep 20, 2023 Sep 20, 2023

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, ";
}

TOPICS
JavaScript , PDF , PDF forms
315
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2023 Sep 20, 2023
LATEST

In the last condition you should use

event.value +="0, "

instead of

event.value ="0, "

as that will overwrite any previous values you applied.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines