1$("input.nombre").bind('keypress', function(event) {
2 var regex = new RegExp("^[a-zA-Z ]+$");
3 var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
4 if (!regex.test(key)) {
5 event.preventDefault();
6 return false;
7 }
8});