Hi Everyone,
I'm constructing a survey and encountering a problem with hiding questions.
Quick run through of the situation: The first question asks respondents to select 1 or more characteristics of a product that can be improved. Each of the answers (if selected) has 3 additional questions that should be shown. For each answer not selected, those 3 additional questions belonging to the answer should be hidden and record the default choices.
After reading through many of the questions in the community, I think I need to hide questions using JavaScript so that the response will set as the default choice that it's set to.
I've tried using display logic and it will not keep the default choices because the question isn't displayed. I've tried using embedded data but I need the default choices as the response due to exporting purposes.
I attempted to use code similar to below, but it wouldn't work if multiple answers were selected. I would appreciate any help.
Qualtrics.SurveyEngine.addOnload(function() {
if("${q://QID1/SelectedChoicesRecode}"!="2") jQuery("#"+this.questionId).hide();
});
Thanks!
How can I hide a questions that aren't selected from a multiple choice multiple answer question?
Best answer by TomG
You need to hide the question then loop through the selected choices and show the question if "2" is selected.
Qualtrics.SurveyEngine.addOnload(function() {
var q = jQuery("#"+this.questionId).hide();
jQuery.each("${q://QID1/SelectedChoicesRecode}".split(", "),function(i,val){
if(val == "2") { q.show(); return; }
});
});
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
