Is there a JavaScript equivalent to .NET\'s String.IsNullOrWhitespace so that I can check if a textbox on the client-side has any visible text in it?
I\'d rather do
trim() is a useful string-function that JS is missing..
trim()
Add it:
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,"") }
Then: if (document.form.field.value.trim() == "")
if (document.form.field.value.trim() == "")