> Don't skip the 2nd question. Carry forward the selected choices in the 1st question to the 2nd question, and add JS to the 2nd question to count the number of choices. If there is one choice, select it and either click the next button (if it is the only question the page) or hide it (if there are other questions on the page).
Hi @TomG, thanks for your suggestion. I think that would help :-)
I would also like to know it there is any other way we can write scripts for custom programming other than Javascript? I am a newbie with Javascript so unsure of how I can select choices with it.
> I would also like to know it there is any other way we can write scripts for custom programming other than Javascript? I am a newbie with Javascript so unsure of how I can select choices with it.
No, JavaScript is the only way to accomplish the task. Use the Qualtrics Question API to select choices. For example, to select the choice with choiceId 1 in a Multiple Choice question you would use:
```
this.setChoiceValue(1, true);
```
> > @Sumeshsdn said:
> > I would also like to know it there is any other way we can write scripts for custom programming other than Javascript? I am a newbie with Javascript so unsure of how I can select choices with it.
> No, JavaScript is the only way to accomplish the task. Use the Qualtrics Question API to select choices. For example, to select the choice with choiceId 1 in a Multiple Choice question you would use:
> ```
> this.setChoiceValue(1, true);
> ```
>
>
@TomG Thanks for the valuable information. I have worked in ConfirmIT before and in it the survey level scripting could be done using JScript. I was hoping for something similar in Qualtrics. Nevermind, an opportunity for me to work on my Javascript skills :-)
Thanks for your help!
Qualtrics.SurveyEngine.addOnload(function()
{
var val1 = "${q://Q32/SelectedChoicesRecode}";
var val2= "${q://QIDQ32/SelectedChoicesCount}";
if(val2==1)
{
this.setChoiceValue(val1, true);
("#NextButton").submit();
}
});
You have number of errors, including your pipes. However, you don't need to pipe anything. Use this script.
@Sumeshsdn, You have number of errors, including your pipes. However, you don't need to pipe anything. Use this script.
Does the script linked here go into the original question or the question with the carry forward responses? I’ve tried it in both and neither seem to be working…
I have a multi-select (MS) with 3 options and a follow-up single-select (SS) with display logic so that it is only shown to those who selected >1 in the MS.
I want the data for those who only select 1 in the MS to be automatically recorded for the follow-up SS so that the respondent doesn’t actually see the SS question but the relevant data is there.
Hi
I believe the script will check the number of displayed choices, if only one choice is displayed, it will be selected and next button will be clicked.
Hence, I think it should go into the second question and the second question shouldn’t have question display logic set up.
Thanks,
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.