Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

Hidden Question Still Showing - JS Advice?

LBG
LBG TNCommunity Member Qubie ✭

I am trying to hide a question for all participants. This code is working, but it flashes the question for a fraction of a second (not ideal). Can anyone suggest code to make sure the question is fully hidden? I cannot use display logic because the question needs to actually occur - just out of the participants' view.


Qualtrics.SurveyEngine.addOnReady(function () {

  var $this = jQuery(this.questionContainer);

  $this.hide(); //this line will hide the question for participants

});

Tagged:

Answers

  • ahmedA
    ahmedA IndiaCommunity Member, XMPN Member Wizard ✭✭✭✭✭

    If you're doing nothing else apart from hiding the question, use the TRUE-FALSE display logic, setting it to false.

    Alternatively, you could try this code:

    Qualtrics.SurveyEngine.addOnload(function () {
        this.getChoiceContainer().hide();
    });
    

    If you're still not satisfied with the results, then add this to the top of your question HTML:

    <div style="margin-bottom:100vh"></div>
    

    This will push everything down by an amount equal to the hieght of the window. So, effectively nothing is visible.

    You can use CSS to avoid the flashing/scrolling down, however, these styles will also be effective in the survey editor. So, unless you know how to work with CSS, I would recommend using one of the 4 methods at your disposal.