<script language=VBScript>
function checkname()
  if trim(document.form1.yonghuming.value)="" then
    alert("用户名为空")
    exit function
  end if
end function
</script>

解决方案 »

  1.   

    拜托,VB可以用alert来弹出对话框吗?
      

  2.   

    拜托,alert 是 DHTML 里的东西,与你什么脚本无关!你自己可以测试!!
      

  3.   

    alert(“****”)
    exit function后不会继续执行了后面的代码阿,而不会停在这里叫你继续输入
      

  4.   

    alert(“****”)
    exit function后继续执行了后面的代码阿,而不会停在这里叫你继续输入