Moloch,
вариант ...
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function(){
var mas = [0, 8, 9, 13, 16, 17, 32, 37, 39, 46, 56, 189];
$("#form .req_field").on("input", function(e) {
var str = $(this).val();
str = str.split("");
var test = str.filter(function(el) {
var kod = el.charCodeAt(0);
var ok = find_in_array(kod);
!ok && $("p").text("введен недопустимый символ! : " + el);
return ok
});
$(this).val(test.join(""))
});
function find_in_array(needle) {
if (needle >= 65 && needle <= 122) return true;
for (var i = 0, l = mas.length; i < l; i++)
if (mas[i] == needle) return true;
return false
};
})
</script>
</head>
<body>
<p></p>
<form id="form" onsubmit="return false">
Имя:<br />
<input type="text" class="req_field" name="username" /><br/>
Комментарий:<br/>
<textarea rows="5" cols="30" name="comment" class="req_field"></textarea><br />
<!--<input type = "button" value="Отправить">-->
<button type="submit">Отправить</button>
</form>
</body>
</html>