How to check if a user input text is all white space characters (space, tab, enter etc) in client side?
Josh's answer is very close to this, but according to w3schools (in May 2014) it is as follows:
function isEmpty(str) { return str.replace(/^\s+|\s+$/gm,'').length == 0; }