I want to toggle display an open-end question based on the selection from a dropdown question on the same page. I did manage to do this for a single choice question and below is the code. But again, this is not needed since we have an inpage display logic feature in Qualtrics. Inpage display logic is not supported for dropdown questions thus I am trying to implement it through javascript. The problem here is that I am unable to find the element type and ID for dropdown questions. Let me know if anyone did manage to implement it and if so how could it be done.
Qualtrics.SurveyEngine.addOnload(function ()
{
document.getElementById("QID8").style.display="none";
this.questionclick = function(event,element)
{
console.log(event, element);
if (element.type == 'radio')
{
var choiceNum = element.id.split('~')[2];
var x = document.getElementById("QID8");
if (choiceNum == 479)
{
x.style.display="block";
}
else
{
x.style.display="none";
}
}
}
});
Best answer by npetrov937
View original