Form field display logic | XM Community
Skip to main content

I have a text form question with 3 fields as seen in screenshot. I have added a display logic saying that option 2 be displayed when option 1 is not empty. Similarly, display option 3 when option 2 is not empty. But when I run the survey, it is asking for option 1 and then moving on to the next question.
image.png

jashtheawesome
Option-based display logic do not have inpage display logic hence, your logic would not work.
As you can see here: it is greyed out.
image.pngYou need to write javascript to achieve the functionality.
Hope it helps!


Hi Deepak,
First, thank you so much for your help. Yes, I saw that but was excited to see the display logic option. Is there any way you can help with the JS as I am not very good at it? If you can't then it is alright. :)
Cheers,
Sujan


jashtheawesome
You can write something like below and change the QID appropriately. I have done for one step
Qualtrics.SurveyEngine.addOnReady(function()
{

jQuery('#QID13').find('tr')[1].hide();
/*Place your JavaScript here to run when the page is fully displayed*/
jQuery("#"+this.questionId+" .InputText").change(function() {
jQuery("#QID13").find('tr')[1].show();

});
});


Hope it helps!


Leave a Reply