如何在提交信息时判断某些项的值不能为空,连空格也不允许?
现在有个需求,就是信息提交时要判断某些项必须输入内容,而且还不能用空格来糊弄,这样的情况该如何处理?下面我有一段代码,不知道为什么总是不能判断就直接提交了. 
  <script>  
 function   checkInsideReco(obj){ 
             if(obj.Descript.value== " "){ 
                         alert( "请输入取消审核的理由 "); 
                         obj.Descript.focus(); 
                         return   false; 
             } 
             form2.SaveMdyButton.disabled=true 
             return   true; 
 } 
  </script>  
  <form   name= "form2 "   method= "post "   action= "Info_Save.asp?Action=CheckInsideReco "   onSubmit= "return   checkInsideReco(this) ">  
 ....... 
  <textarea   name= "Descript "   cols= "60 "   rows= "5 "   id= "Descript ">  </textarea>  
  <input   name= "Submit2 "   type= "submit "   id= "SaveMdyButton "   class= "button01-out "   value= "通过审核 ">  <input   name= "Submit1 "   type= "submit "   id= "SaveMdyButton "   class= "button01-out "   value= "取消审核 ">  
  </form>  
 我需要的是在点取消审核时判断Descript里的内容是否为空,且不能是用空格键敲几下就被检查为内容不为空,必须要输入内容才行,如果满足,再提醒下 "你真的要取消审核吗? "点 "是 "就正式提交信息,点 "否 "就什么操作都不做. 
 在点通过审核时则简单了,就是提醒 "你真的要通过审核吗? "点 "是 "就正式提交信息,点 "否 "就什么操作都不做. 
 这个JS代码该如何修改才能实现? 
------解决方案--------------------写个JAVASCRIPT函数   
 function trim(mystr){ 
 while ((mystr.indexOf( "  ")==0) && (mystr.length> 1)){ 
 mystr=mystr.substring(1,mystr.length); 
 }//去除前面空格 
 while ((mystr.lastIndexOf( "  ")==mystr.length-1)&&(mystr.length> 1)){ 
 mystr=mystr.substring(0,mystr.length-1); 
 }//去除后面空格 
 if (mystr== "  "){ 
 mystr= " "; 
 } 
 return mystr; 
 }   
 if(trim(obj.Descript.value)== " ") 
 {   
 }