@LawrenceT, Shorter, more efficient version: jQuery('input[choiceid=' + QB + ']').prop('checked',true).closest("li").hide(); Thanks again Tom. Would be good to know how to learn how to use Javascript in Qualtrics.
Here is the code to prepopulate an option and hide it. The task was to read a code from a list and then fill a question and show the codes that had not been selected. var QB = ""; QB = "${e://Field/eventCode}";if (QB.length > 0) { jQuery('input[choiceid=' + QB + ']').prop('checked',true); jQuery('input[choiceid=' + QB + ']').closest("li").hide() }
Thanks Tom, I don’t suppose you would know how to hide the option as well? By the way I have noticed you have been the go to person on the forum when it comes to giving solutions. How did you know the library for Qualtrics in Javascript?
Hi All! I want to mention that we have added a section to our support page that include this use case, which you can view here! Hi the issue we are having is that all those who have partially completed will also be added to the count as complete. We want it to close the survey once it hits the quota so those who are partially doing the survey will have a closing screen if they try and continue.
You can use carry forward and Default choices options. if the same options list are there. Hmm I tried it but this didn’t seem to work the Default just came up blank. Perhaps embedded data is a way to go? Although I don’t know how to do it for multiple answers.
I should add how to hide the question since I mentioned it although this commented on other posts. But right in saying that this has the flexibility if the codeframes are different between the two questions. this.getQuestionContainer().hide(); this.hidePreviousButton(); this.hideNextButton(); this.clickNextButton();
Thanks everyone for your help. Both were really best answers. I now have the library of functions, unfortunately, there really isn’t any examples of how to use some of them. For example, GetChoices I have done a google search on this and can’t find any examples of this. I’ve tried using it but doesn’t function as I want it to as in read in a previous multiple response question.So, the next step is to find a resource that gives examples of how to use it. Some have been but not all.
I would like to be able to do this as well without having to use branching and blocks as I want to keep the blocks to signify sections not having to deal with many blocks. I guess its just the way its designed.
There is a much better way. Qualtrics.SurveyEngine.addOnload(function(){ var TT1 = parseInt("${q://QID26/SelectedChoicesRecode}"); if ([2,5,6,7,8,9,11].includes(TT1)) { for (var i = 0; i < 3; i++) { jQuery('input[type="checkbox"]').eq(i).prop('checked',true) } jQuery("#"+this.questionId).hide(); }});Qualtrics.SurveyEngine.addOnReady(function(){ if(jQuery(this.questionId).val) this.clickNextButton(); }});
This has been resolved there was another javascript that was affecting it. But if anyone has tips of how to write this better.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.