Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only Cyrillic input text form

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

like image 315
SGh Avatar asked Oct 30 '12 12:10

SGh


People also ask

Where is Cyrillic used?

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.

Who made the Cyrillic?

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.

Where did Cyrillic originate?

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.


1 Answers

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/

like image 191
VisioN Avatar answered Oct 01 '22 15:10

VisioN