<script>
function chk(){
   if(document.form1.t1.value==""){
      alert("warning!!!!");
   }
}
</script>
<form name=form1>
<input name=t1 type=textbox value="" onblur=chk()>
</form>

解决方案 »

  1.   

    <script language="vbScript">
    <!--
    function form1_onsubmit()
    d=document.getElementsByTagName("input")
    for i=0 to document.getElementsByTagName("input").length-1
    if (document.getElementsByTagName("input")(i).type="text") and (document.getElementsByTagName("input")(i).value="") then
    alert("有空的text")
    form1_onsubmit=false
    end if
    nextend function
    //-->
    </script>
    <form name=form1>
    <input name=t1 type=textbox value="">
    <input type="text" name="">
    <input type="submit">
    </form>