Skip to content

Instantly share code, notes, and snippets.

@morozVA
Created May 23, 2018
Embed
What would you like to do?
js запретить печатать кириллицу в input
function Latin(obj) {
if (/^[a-zA-Z0-9 ,.\-:"()]*?$/.test(obj.value))
obj.defaultValue = obj.value;
else
obj.value = obj.defaultValue;
}
<input onkeyup="Latin(this);">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment