I have a textbox and I am trying to validate it in jquery. The condition is, it should not validate if user only types space bar. Currently it validates it, since the length is not equal to 0. How can I validate for empty white spaces?
var name = $('#txtName').val();
if (name.length <= 0) {
$('#divName').css("border-color", "red");
ShowHideById('sendEmailByCustomer', 'true');
isValid = false;
return;
}