Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

allow only letters javascript

document.getElementById('inputid').onkeypress=function(e){
    if(!(/[a-z ]/i.test(String.fromCharCode(e.keyCode)))) {
        e.preventDefault();
        return false;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #letters #javascript
ADD COMMENT
Topic
Name
4+6 =