var title = document.all.TITLE.value.replace(/^\s+|\s+$/g, ""); if(title==""){ alert("请填写意见标题"); return; }