hi! I am encountering this problem where I need a user to enter data in a text field but I can’t invalidate their input if they just enter spaces. What I mean is that right now I can alert the user to enter the data in the text field (required field in form type of situation) if they don’t enter any characters but the glitch of my system is that it goes through if they just enter spaces with the space bar.
QUESTION:
Can I find out that the characters in my text field entered by the user are not SPACES???
Thanks :crazy:
this will tell if x is white space or not (any number of spaces, tabs or newlines)
isNaN(x+" 0")
if that line is false, its white space (and probably spaces)
thanks!!!