如代码:
<form action="addAdmin" name="formA" method="post"  onsubmit="return doRegit()" onsubmit="return check()">
怎么实现这个功能,代码要如何改。

解决方案 »

  1.   

    你就一个return就好了啊,把check方法的内容都判断写在doRegit那边不就好了么,不需要一个按钮同时实现2个事件吧
      

  2.   

    你是需要实现两个方法吗?点击submit的时候执行2个方法
      

  3.   

    我给你代码你自己看?
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <title> New Document </title>
      <meta name="Generator" content="EditPlus">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
      <script>
            var arr=new Array(); function Fa(){
     for(var i=0;i<arr.length;i++){
      arr[i]();//call 
     }
    } function Fb(){
      alert(0);
    }
    arr.push(Fb);
    function Fc(){
      alert(1);
    }
    arr.push(Fc);
      </script>
     </head> <body>
        <button onclick="Fa();">click me</button>
     </body>
    </html>
      

  4.   

    这个应该可以满足你的需求了吧,自己添加return 就OK了
      

  5.   

    你为什么不在doRegit()方法里调用check()方法呢?
      

  6.   

    onclick="this.form.action='........';this.form.submit();";
      

  7.   

    得到表单对象 设置action就可以了。。
      

  8.   

      你可以指定form的submit,就好象在 form外 的指定submit
      

  9.   

    你可以在Action在跳转一次啊何必要提交两次啊!!!你也可以写个函数然后在函数里面改变action=“”里面的值就行了!!!
      

  10.   

    可以用两个submit啊,就是两个按钮各自添加一个onclick函数,这样就知道是哪个submit的提交了。希望对你有用。