Changing textbox language to English
If a user switched his keyboard language and type in another language, I want to automatically change his keyboard language in a specific textbox. Let's say I have 3 textboxes. The user can type in the first two textboxes in whatever language, but when it comes to the third textbox, I want English characters only.
Is there a way to do that?
I tried this, but no luck.
- $("#thirdTextBox").on('keydown', function(e) {
- console.log(e.keyCode);
- if( e.keyCode == 90 ) {
- e.preventDefault();
- $(this).append('y').focus();
- }
- if( e.keyCode == 89 ){
- e.preventDefault();
- $(this).append('z').focus();
- }
- });