How do I restrict input text into a web form textbox only Cyrillic characters?
It is currently used either exclusively or as one of several alphabets for languages like Belarusian, Bulgarian, Kazakh, Kyrgyz, Macedonian, Montenegrin, Russian, Serbian, Tajik (a dialect of Persian), Turkmen, Ukrainian, and Uzbek.
Saints Naum and Clement, both of Ohrid and both among the disciples of Cyril and Methodius, are sometimes credited with having devised the Cyrillic alphabet. (2) Two alphabets, the Cyrillic and the Latin, are used for writing Slavic languages.
The Early Cyrillic alphabet, also called classical Cyrillic or paleo-Cyrillic, is a writing system that was developed in the First Bulgarian Empire during the late 9th century on the basis of the Greek alphabet for the Slavic people living near the Byzantine Empire in South East and Central Europe.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With