<html>
<head>
</head>
<body><form name="form3" method="post" action="http://3333">
<input type="button" name="aa" value="aa" onclick="disButton(this.form)">
<input type="button" name="bb" value="bb" onclick="disButton(this.form)">
<input type="button" name="cc" value="cc" onclick="disButton(this.form)">
<input type="button" name="wahdee" value="submit2" onclick="disButton(this.form)">
<input type="button" name="website" value="提交" onclick="disButton(this.form)">
</form>
<script language="javascript">
function disButton(str)
{
var a = document.getElementsByTagName("input");
for(var i=0; i<a.length; i++)
{
if(a[i].type=='button'){
//alert(i)
  a[i].disabled = true;
//this.form.submit();
}}
str.submit();
}
</script>
</body>
</html>

解决方案 »

  1.   

    还是没有值呢.<form name="form3" method="post" action="bb.php">*******bb.php<? echo "aa:".$aa."<br>"; 
     echo "bb:".$bb."<br>";?>全部是空值 @_@
      

  2.   

    php不会啊 ,但从抓包来看值应该是post下去了
    <html>
    <head>
    </head>
    <body><form name="form3" method="post"  >
      <input name="aaaaaaa" type="text" id="aaaaaaa" value="111111111">
      <input name="bbbbb" type="text" id="bbbbb" value="22222222">
      <input type="button" name="aa" value="aa" onclick="disButton(this.form)">
    <input type="button" name="bb" value="bb" onclick="disButton(this.form)">
    <input type="button" name="cc" value="cc" onclick="disButton(this.form)">
    <input type="button" name="wahdee" value="submit2" onclick="disButton(this.form)">
    <input type="button" name="website" value="提交" onclick="disButton(this.form)">
    </form>
    <script language="javascript">
    function disButton(str)
    {
    var a = document.getElementsByTagName("input");
    for(var i=0; i<a.length; i++)
    {
    if(a[i].type=='button'){
    //alert(i)
      a[i].disabled = true;
    //this.form.submit();
    }}
    str.submit();
    }
    </script>
    </body>
    </html>
      

  3.   

    <script language="javascript">
    function disButton(str)
    {
    form.submit();
    var a = document.getElementsByTagName("input");
    for(var i=0; i<a.length; i++)
    {
      a[i].disabled = true;
    }}
    这样试试,表单元素disable后服务器端当然是取不到值的
    </script>
      

  4.   

    <input type="button"
    或者
    <input disabled
    的值是不会递交到后台去的~所以你应该把要递交的值的input写成text、password、textarea等
    然后不用disabled所有的input,只要在点击按钮之后disabled按钮就可以了~~
    然后用js教本来form3.submit();递交表单就可以了
      

  5.   

    现在表单能提交了, 而且也能传递button的值。但
    我加了一个隐藏域
    <input type="hidden" name="testtest" value="80">就读不了这个域的值。@_@