I have a textbox collecting user input in my JS code. I would like to filter junk input, like strings that contain whitespaces only.
In C#, I would use the following
Use a regular expression:
if (inputString.match(/^\s*$/)) { alert("not ok"); }
or even easier:
if (inputString.match(/\S/)) { alert("ok"); }
The \S means 'any non white space character'.