I have a survey of multiple choice questions in which participants can select two answer options using the left and right arrow keys, which then submits the page. Currently the code I'm using is this excellent example (also copied below for clarity).
It's working well, but what I want it to do is to visibly select (i.e. make the usual choice selection circle appear next to the answer) the participants' choice before it submits the page, so they can see which one they chose. Currently, while the choice is recorded on the back end, the question advances without a visual indication of the choice.
Is this possible? I'm a Javascript newbie, so I've been playing around with focus etc without much success
Qualtrics.SurveyEngine.addOnload(function() { var qid = this.questionId;
document.onkeydown = function(event) { console.log('keydown',event);
if (event.which == 37) { event.preventDefault();
Qualtrics.SurveyEngine.registry[qid].setChoiceValue(1, true);
jQuery('#NextButton').click();
} else if (event.which == 39) { event.preventDefault();
Qualtrics.SurveyEngine.registry[qid].setChoiceValue(2, true);
jQuery('#NextButton').click(); } }
});
How to select answer options using arrow keys?
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.

Practically, this is one 'block', with a question with the participant image and a multiple choice question with two (horizontal) options. I'd like participants to be able to select either of the options with the left or right arrow keys, and for it to look like this for a second or so (in this example, after pressing the right arrow key):
Before the page is submitted automatically.