jQuery se a entrada tem espaço branco vazio
if ($("#comments").val().replace(/^\s+|\s+$/g, "").length != 0){
Weary Wildebeest
if ($("#comments").val().replace(/^\s+|\s+$/g, "").length != 0){
$('input').keypress(function( e ) {
if(e.which === 32)
return false;
});