<html>
<head>
<script language=vbscript>    
    
Sub CheckValue()    
    
      If  document.all.kind1.value="3"  and document.all.user_bm.value=""  then   
      alert("???入被曝光?位!")    
      window.event.returnvalue=false    
     return    
        End If    
       
              
End Sub
</script>  
</head>
<body>
<input type="text" id="kind1" value="3" >
<input type="text" id="user_bm" value="check" >
<input type="button" value="check" onclick="CheckValue()">
</body></html>没错,有错的地方可能是你then不小心按回车换行了。

解决方案 »

  1.   

    <script language=vbscript>    
              alert("请您输入被曝光单位!")    ''你到底是写vbscript 还是javascript??
      

  2.   

    fantiny(虽然我是菜鸟,不过我是乐于助人的菜鸟) 用的也不是中文
    系统吧?呵呵,你写alert("???入被曝光?位!")这句时出现了乱码。
      

  3.   

    <script language=vbscript>    
        
    Sub CheckValue()    
        
          If  document.all.kind1.value="3"  and document.all.user_bm.value=""  then   
          alert("请您输入被曝光单位!")    
          window.event.returnvalue=false    
         return    
            End If    
           
                  
    End Sub                  
        
    </script>  
    我用的是vbscript ,因为我单个判断是可以的, 两个条件连起来就不行了, 不是报错,就是这两个条件符合的时候他不跳出警告语
      

  4.   

    我的then没换行,在这个里面自动换行 了,我在程序里是没有换行的
      

  5.   

    我怎么看你这好像都是javascript的东西呢?alert----vbscript应该是msgbox吧?
      

  6.   

    解决好了,这个语句没问题,呵呵,要把“return”去掉的,是我师傅把函数名搞错了,谢谢大家了