Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

validar solo letras js

$("input.nombre").bind('keypress', function(event) {
  var regex = new RegExp("^[a-zA-Z ]+$");
  var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
  if (!regex.test(key)) {
    event.preventDefault();
    return false;
  }
});
Source by cesar.pe #
 
PREVIOUS NEXT
Tagged: #validar #solo #letras #js
ADD COMMENT
Topic
Name
8+6 =