Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to detect keyboard layout js

function checkKeyboard(ob,e){
        re = /d|w|[.$@*/+-^!()[]~\%&=?><{}"',:;\_]/g;
      a = e.key.match(re);
      if (a == null){
        alert('Error 2:
Non English keyboard layout is detected!
Set the keyboard layout to English and try to fill out the field again.');
        ob.val('');
        return false;
      }
      return true;
    } 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #detect #keyboard #layout #js
ADD COMMENT
Topic
Name
3+6 =