I have a simple check ( .val() == "" ) with jQuery if textarea is empty or not before submitting.. it works, but it counts whitespaces.
How can I ignore white spaces in this check?
// Post guestbook; Check on frontend before submitting
function postGuestbook() {
if ($('.post-form textarea').val() == "")
{
$('div.message.error').show();
return false
}
else {
$('.post-form input[type="submit"]').attr('disabled', 'disabled');
return true;
}
}