Created
November 1, 2011 15:30
-
-
Save livando/1330818 to your computer and use it in GitHub Desktop.
quick javascript snippet which uses jQuery and Regular expressions to not allow special characters.
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
var filename = jQuery("#uploadform #fileName").val(); | |
var characterReg = /^\s*[a-zA-Z0-9\._,\s]+\s*$/; | |
if(!characterReg.test(filename)) | |
alert("NOT OK " + filename); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment