How to disable the tab key in a survey to prevent respondents from tabbing from 1 field to the next? | XM Community
Skip to main content
Hello, I have several text entry questions in a survey. I'd like to disable the ability of users/respondents from tabbing from one field to the next in order to 'force' them to spend a little more time on each question.



Thanks!
The way to do this is to listen for a key press, and then if the key is tab, to return false; you can look at other answered posts for how to do that.



However, you should not do this unless you know your participants as it will be a huge accessibility issue for those using a screen reader among others.
mattyb513, you make an excellent point about accessibility. Noted. We know our population well enough to want to move forward. I've tried this, with no success. Any suggestions?



Qualtrics.SurveyEngine.addOnload(function()

{

$("input:text").keypress(function (event) {

if (event.keyCode == 9) return false;

})

});
Looks like you have to use the `.preventDefault()` method:



https://gist.github.com/mattbloomfield/3901f7cdc26202d2a8178509981d7152
Thanks. That did it. Much obliged.

Leave a Reply