Last active
October 17, 2017 14:21
-
-
Save ConnectedReasoning/7ac7e7fb9fc7b6207ef3f88dcd8d8baa to your computer and use it in GitHub Desktop.
Simple alphanumeric space and underline and dash javascript validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateField() { | |
return{ | |
IsValidInput : function(input){ | |
var isValid = false; | |
var validChars = /^[a-z\d\-_\s\/]+$/i; | |
if (validChars.test(input)){ | |
isValid = true; | |
} | |
return isValid; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple function for javascript whitelist validation