<form name="theForm" method="post" action="billaddadmin.asp">
<input type='text' name='billno' value=''>
<input type="button" name="Submit1" value="保 存" onClick=""return Juge()"">
</form><div id="sending2" style="position:absolute; top:180px; left:165px; z-index:10; display:none; width: 345px; height: 43px;"> 
  <table width=92% border=0 align="center" cellpadding=0 cellspacing=0>
<tr> 
      <td height="39"> 
<table width=96% height=32 border=0 cellpadding=0 cellspacing=2 bgcolor="#66CC66">
<tr> 
            <td height="28" align=center bgcolor=#CEFF9C>正在执行, 请稍等...</td>
          </tr>
        </table></td>
    </tr>
  </table>
</div><SCRIPT language="javascript">  
<!--
function Juge()
{
  if (theForm.billno.value == "")
  {
  alert("请填写billno。");
  theForm.billno.focus();
  return (false);
  }  if(confirm("确认保存吗?"))
      sending2.style.display="";    
      window.setTimeout("document.theForm.submit();",2000);  
  else
  return false;
}
-->
</SCRIPT>请问:怎么DIV-sending2怎么不显示呢?怎么不是显示了两秒钟后提交呢?
      sending2.style.display="";    
      window.setTimeout("document.theForm.submit();",2000);  
以上这两行代码如何改进呢?

解决方案 »

  1.   

    sending2.style.display="none"; 隐藏
      

  2.   

    <form name="theForm" method="post" action="billaddadmin.asp">
    <input type='text' name='billno' value=''>
    <input type="button" name="Submit1" value="保 存" onClick="return Juge()">
    </form><div id="sending2" style="position:absolute; top:180px; left:165px; z-index:10; display:none; width: 345px; height: 43px;">  
      <table width=92% border=0 align="center" cellpadding=0 cellspacing=0>
    <tr>  
      <td height="39">  
    <table width=96% height=32 border=0 cellpadding=0 cellspacing=2 bgcolor="#66CC66">
    <tr>  
      <td height="28" align=center bgcolor=#CEFF9C>正在执行, 请稍等...</td>
      </tr>
      </table></td>
      </tr>
      </table>
    </div><SCRIPT language="javascript">   
    <!--
    function Juge()
    {
      if (theForm.billno.value == "")
      {
      alert("请填写billno。");
      theForm.billno.focus();
      return (false);
      }  if(window.confirm("确认保存吗?")){
      sending2.style.display="";   
      window.setTimeout("document.theForm.submit();",2000);   
      }else
      return false;
    }
    -->
    </SCRIPT>
      

  3.   

    一开始sending2是隐藏的,我是想在提交时将sending2显示出来的。
      

  4.   

    document.getElementByID("sending2").style.display="block"; 显示
      

  5.   

    改了两处<form name="theForm" method="post" action="billaddadmin.asp">
    <input type='text' name='billno' value=''>
    <input type="button" name="Submit1" value="保 存" onClick="return Juge()"><!-- 这里,原来是 onClick=""return Juge()"",多了引号 -->
    </form><div id="sending2" style="position:absolute; top:180px; left:165px; z-index:10; display:none; width: 345px; height: 43px;">  
      <table width=92% border=0 align="center" cellpadding=0 cellspacing=0>
    <tr>  
      <td height="39">  
    <table width=96% height=32 border=0 cellpadding=0 cellspacing=2 bgcolor="#66CC66">
    <tr>  
      <td height="28" align=center bgcolor=#CEFF9C>正在执行, 请稍等...</td>
      </tr>
      </table></td>
      </tr>
      </table>
    </div><SCRIPT language="javascript">   
    <!--
    function Juge()
    {
      if (theForm.billno.value == "")
      {
      alert("请填写billno。");
      theForm.billno.focus();
      return (false);
      }  if(confirm("确认保存吗?")) { //这里if后面跟两句需要用{}括起
      sending2.style.display="";   
      window.setTimeout("document.theForm.submit();",2000);
      }
      else
    return false;
    }
    -->
    </SCRIPT>