Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

alphanumeric with space regex

var regex = new RegExp("^[A-Za-z0-9? ,_-]+$");
            var key = String.fromCharCode(event.charCode ? event.which : event.charCode);
            if (!regex.test(key)) {
                event.preventDefault();
                return false;
            }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #alphanumeric #space #regex
ADD COMMENT
Topic
Name
7+8 =