Hi guys, for some reason I need to inform the subjects that they did not select the other option in a question of two options.
For example, the question is
Which animal do you like?
1. Cats
2. Dogs
Say, if one select 1. Cats. then an alert pops up that says "You don't like Dogs?"
I am trying by googling this myself and it works with a single click function
Qualtrics.SurveyEngine.addOnload(function()
{
this.questionclick = function(event, element) {
if (element.type == 'radio')
{
if (this.getChoiceValue()==2){
var choice= this.getChoiceVariableName(1);}
if (this.getChoiceValue()==1){
var choice = this.getChoiceVariableName(2);}
var r = confirm("Reminder: This is the your choice "+choice); //design your question here
if (r == true) {
that.clickNextButton();
} else {
}
}
}
});
However, I need combine this with doubleclicking to the next page, then it does not work.
Qualtrics.SurveyEngine.addOnload(function() {
this.hideNextButton();
var that = this;
jQuery('.LabelWrapper').dblclick(function() {
if (this.getChoiceValue()==2){
var choice= this.getChoiceVariableName(1);}
if (this.getChoiceValue()==1){
var choice = this.getChoiceVariableName(2);}
var r = confirm("Reminder: This is the your choice "+choice); //design your question here
if (r == true) {
that.clickNextButton();
} else {
}
});
I highly appreciate any help that I can get.
Thank you everyone!
Page 1 / 1
Hi @Rui ,
I don't know Javascript well enough to troubleshoot this code or how it works in Qualtrics. But I'm wondering if Javacript has to be used at all? Is it a requirement that the "You don't like dogs/cats" messages be pop-up alerts? Or could you get by with using putting those messages in a Descriptive Text object and using Display Logic to show them to the respondent?
I don't know Javascript well enough to troubleshoot this code or how it works in Qualtrics. But I'm wondering if Javacript has to be used at all? Is it a requirement that the "You don't like dogs/cats" messages be pop-up alerts? Or could you get by with using putting those messages in a Descriptive Text object and using Display Logic to show them to the respondent?
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.