Only Cyrillic input text form

javascript, jquery

Solution

Firstly, you should use encoding which supports Cyrillic characters (e.g. UTF-8) both for page and for scripts. Then, you may use regular expression to check:

$("input").keyup(function() {
    this.value = this.value.replace(/[^а-яё]/i, "");
});​

DEMO: http://jsfiddle.net/CSjkP/

Problem

How do I restrict input text into a web form textbox only Cyrillic characters?

Original source