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