Goodnight. Today, on Yandex, I saw such a chip, when you start entering a password using the Russian keyboard layout, the red inscription “Change Layout” appears. How can this be implemented? How can I check the correct keyboard layout? Incorrect keyboard layout

    1 answer 1

    It is quite simple to check the input string for the occurrence of Russian alphabet characters using regexp.

    • More specifically, you can write? - spoilt
    • five
      So try: $ ('# txt'). Keyup (function (e) {if ($ (this) .val (). Match (/ ([AZA-ZA) +) /)) {alert ('Change layout ');}}); - Deonis
    • one
      So also not quite right. [А-ЯЁ][а-яё] will also catch the letter e, which in Unicode is in another block. - pirj