<div>
<input id="enInput" style="text-transform: uppercase">
</div>
$("#enInput").keydown(function (event) {
var currentTarget = event.currentTarget;
currentTarget.value=currentTarget.value.replace(/[^a-zA-Z]/g,'');
var regex = /^[a-zA-Z ]+$/;
var str = String.fromCharCode(!event.charCode ? event.which : event.charCode);
if (!regex.test(str)) {
event.preventDefault();
return false;
}
});
function onlyEn(obj) {
var doc = document.getElementById(obj.id);
var str = String.fromCharCode(!event.charCode ? event.which : event.charCode);
var regex = /^[a-zA-Z ]+$/;
if (!regex.test(str)) {
event.preventDefault();
return false;
}
}