-
-
Save 0xnbk/749751 to your computer and use it in GitHub Desktop.
Javascript function to check for white spaces.
This file contains hidden or 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 hasWhiteSpace(s) | |
{ | |
reWhiteSpace = new RegExp(/^\s+$/); | |
// Check for white space | |
if (reWhiteSpace.test(s)) { | |
alert("Please Check Your Fields For Spaces"); | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment