Hi everyone!
I'm trying to have a pop-up message on the screen upon selection of a particular answer for a multiple-choice question.
I'm trying to see if I can change participants' responses after the warning message, so it is important to record their first choices and whether they changed their minds or not.
If choice #1 is selected, I need a pop message to show on the screen at the moment the participant select that choice.
I need Qualtrics to record the response they selected that caused the pop up to appear, and
I need to provide an opportunity for participants to change their choices after seeing the pop up message.
I need that both the first choice and second choice to be recorded.
I tried this:
var that = this;
var msg = 'INSERT ERROR TEXT HERE';
jQuery("#NextButton").on('click',function(){
var correctrecode = 8;
var choiceid = jQuery("#"+that.questionId+" input[type='radio']:checked").attr("choiceid");
var selectedrecode = that.getChoiceRecodeValue ( choiceid );
if(correctrecode==selectedrecode){
alert(msg);
}
});
Unfortunately, this is not what I need because it does not provide a chance for participants to change their choices.
Also, I would like the pop message to show up in the middle of the screen, not at the top.
Any help will be appreciated. My JavaScript knowledge is very limited.
Thank you!
Angélica
display a pop message on screen when a particular response is given
Best answer by ahmedA
Try this JS:
Qualtrics.SurveyEngine.addOnReady(function () {
let relevant_choice = this.questionContainer.querySelectorAll("li")[0];
relevant_choice.onclick = function (click) {
let recall = confirm("Do you really want to share?");
if (!recall) click.preventDefault();
};
});
You may have to change the 0 to 1 based on your arrangement.
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.
