How to disable input on the Numeric Keypad
Summary | This article describes how to disable the use of the numeric keypad on a standard 107-key keyboard. |
Applies to | AskiaDesign |
Written for | Scriptwriters and Survey Authors |
Keywords | disable; number; script ; keypad; numpad; java; design |
This function will allow survey programmers to disable the use of the numeric keypad using JavaScript.
This will work for Web, CATI (web screens) and AskiaFace (web screens).
Survey Layout
First, ensure that you have the option Use web screens in VOICE/FACE enabled on your screen group:
Please note this function will not work if this option is not enabled.
Implementation
Now that you have enabled web screens in your CATI survey, input this following JavaScript at the end of "Head" in Internet Settings:
<script type="text/javascript">
document.onkeydown = function (e) {
if (e.which >= 96 && e.which <= 105) {
return false;
}
}
</script>
This script as currently written will only disable keys 0 - 9 on the numeric keypad (codes 96 through 105). If you want to disable more than that, you can find other keys and their corresponding codes here.
This function, when enabled, will not accept input from the numeric keypad for coded, numeric, open-ended, and date questions.