按照现有的搜索按钮上的onclick写法,应该是搜索内容不为空时才进行搜索,JS应该修改为
onclick="if($.trim($('#q').val()) != '') {$('#searchForm').submit();} else {return false;}"