How can I program a hidden / backgroud question?

cloofcloof BerlinCommunity Member Qubie ✭

How can I program a hidden / backgroud question?

I have a question that based on a previous question (aided awareness) random and evenly selects two known brands and makes these default selections. I would like this to happen in the background without showing the question to the respondents. I was thinking about adding Javascript to autoforward/advance but this does not seem to work. Any other way to make such questions with default choices in the background?
Many thanks!

Best Answer

  • TomGTomG Raleigh, NCCommunity Member Wizard ✭✭✭✭✭
    Accepted Answer

    This will hide the question and go to the next page:

    Qualtrics.SurveyEngine.addOnload(function() {
        jQuery("#"+this.questionId).hide();
        this.clickNextButton();
    });
    

    If you don't want them to see the question flash by, add padding to the top of the question text to push it off the bottom of the page.

Answers

  • PeeyushBansalPeeyushBansal IndiaCommunity Member Wizard ✭✭✭✭✭

    You can use code like

  • cloofcloof BerlinCommunity Member Qubie ✭

    Ok I see, this would just generate everything in the background...
    As the scenario is quite complex, based on different constellations of brands aware, then a random, even selection of 2 brands of the subset and then the default choice of these (i.e. using disply logic, advanced randomization and default choice), I'd prefer to keep it as a separate question, just not showing this to respondets but auto forwarding with the default choice saved in the variable...

  • cloofcloof BerlinCommunity Member Qubie ✭

    Awesome, TomG!
    This is exactly what I was looking for!

  • chinglncchinglnc Community Member Qubie ✭

    Hi Tom

    Can you advise what you mean by "add padding to the top of the question text to push it off the bottom of the page"- how do I do that please?

    Thank you

  • TomGTomG Raleigh, NCCommunity Member Wizard ✭✭✭✭✭
    <div style="padding-top:2500px">Question text</div>
    
Sign In to Comment