how to detect keyboard layout js

Solutions on MaxInterview for how to detect keyboard layout js by the best coders in the world

showing results for - "how to detect keyboard layout js"
Henri
19 Jan 2017
1function checkKeyboard(ob,e){
2        re = /\d|\w|[\.\$@\*\\\/\+\-\^\!\(\)\[\]\~\%\&\=\?\>\<\{\}\"\'\,\:\;\_]/g;
3      a = e.key.match(re);
4      if (a == null){
5        alert('Error 2:\nNon English keyboard layout is detected!\nSet the keyboard layout to English and try to fill out the field again.');
6        ob.val('');
7        return false;
8      }
9      return true;
10    } 
11