<html>
<head>
<script language="javascript" >
function executeit()
{
   document.testfrm.btn_submit.disabled=true;
   return 1;
}
</script>
</head>
<body>
<table>
<form name ="testfrm"  action="submitpage.asp" onsubmit="return executeit()">
<input name="content" type="text" width="100" >
<hr>
<input name="btn_submit" type="submit" >
</form>
</table>
</body>
</html>

解决方案 »

  1.   

    在表单中添加事件:onSubmit="function();",然后在function中让提交的按钮变灰,好象直接使用this.按钮名.disabled=true也行。
    如果用onSubmit="return function();",function中还可以通过return false阻止表单提交。
      

  2.   

    看CSDN的:<SCRIPT LANGUAGE="javascript">
    <!--
    function input(ok)
    {
        var M1=ok.ReplyContent.value;
        if (M1=='') {
    alert('回复内容不可以为空.');
    return false;
    }
    ok.B1.disabled =true;
    ok.B2.disabled =true;
        return true;
    }
    //-->
    </script>
      

  3.   

    楼上的,我这样怎么就不管用了......<html>
    <head>
    <script language="javascript">
    <!--
    function input(test)
    {
        var M=test.name.value;
        if(M==''){
       alert('内容不可以为空.');
       return false;
    }
    test.A.disabled =true;
    test.B.disabled =true;
        return true;
    }
    //-->
    </script>
    </head>
    <body>
    <table width="452" height="159" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
    <form name ="test"  action="" onsubmit="return input(test)">
    <input name="name" type="text" width="100" ><input name="A" type="submit" value="提交">
    <input name="B" type="reset" value="重置">
    </form>
    </td>
      </tr>
    </table>
    </body>
    </html>