<legend id='tIyq5'><style id='tIyq5'><dir id='tIyq5'><q id='tIyq5'></q></dir></style></legend>
    <bdo id='tIyq5'></bdo><ul id='tIyq5'></ul>
<i id='tIyq5'><tr id='tIyq5'><dt id='tIyq5'><q id='tIyq5'><span id='tIyq5'><b id='tIyq5'><form id='tIyq5'><ins id='tIyq5'></ins><ul id='tIyq5'></ul><sub id='tIyq5'></sub></form><legend id='tIyq5'></legend><bdo id='tIyq5'><pre id='tIyq5'><center id='tIyq5'></center></pre></bdo></b><th id='tIyq5'></th></span></q></dt></tr></i><div id='tIyq5'><tfoot id='tIyq5'></tfoot><dl id='tIyq5'><fieldset id='tIyq5'></fieldset></dl></div>

    1. <small id='tIyq5'></small><noframes id='tIyq5'>

      1. <tfoot id='tIyq5'></tfoot>
      2. 多个提交按钮点击问题?

        时间:2023-06-05
          <bdo id='gdTCP'></bdo><ul id='gdTCP'></ul>

          • <small id='gdTCP'></small><noframes id='gdTCP'>

            <tfoot id='gdTCP'></tfoot>
              <tbody id='gdTCP'></tbody>
            <i id='gdTCP'><tr id='gdTCP'><dt id='gdTCP'><q id='gdTCP'><span id='gdTCP'><b id='gdTCP'><form id='gdTCP'><ins id='gdTCP'></ins><ul id='gdTCP'></ul><sub id='gdTCP'></sub></form><legend id='gdTCP'></legend><bdo id='gdTCP'><pre id='gdTCP'><center id='gdTCP'></center></pre></bdo></b><th id='gdTCP'></th></span></q></dt></tr></i><div id='gdTCP'><tfoot id='gdTCP'></tfoot><dl id='gdTCP'><fieldset id='gdTCP'></fieldset></dl></div>

                  <legend id='gdTCP'><style id='gdTCP'><dir id='gdTCP'><q id='gdTCP'></q></dir></style></legend>
                1. 本文介绍了多个提交按钮点击问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个表单,它在单击提交按钮时在 DB 中插入数据,但问题是当客户端多次单击按钮时,它发送多个创建请求意味着同一数据的同一时间有多个按钮单击事件,但不能这样.

                  I have a form which inserts data in DB on Submit button click but the problem is when client click the button multiple times its sends multiple create requests means multiple button click events for the same time of same data, which must not be.

                  当客户端第一次单击提交按钮时,我尝试禁用该按钮,但此后它不会调用服务器单击事件处理程序,也不会在禁用后触发服务器单击事件.

                  I tried to disable the button when client click the Submit button first time but after this it does not call server click event handler or not fire the server click event once it got disabled.

                  如何处理这个多次点击问题..

                  How to handle this multiple click problem..

                  我使用以下代码禁用按钮

                  I used the following code to disable the button

                   <script type="text/javascript">
                       function checkAuth(obj)
                       {
                           if(Page_ClientValidate("ValidationGroupName"))
                              obj.disabled=true;      
                       }
                   </script>
                  
                          <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                  OnClick="btnSubmit_click" OnClientClick="checkAuth(this)" CssClass="FormButton" 
                  ValidationGroup="ValidationGroupName" />
                  

                  推荐答案

                  不要禁用按钮,只是防止第二次提交.

                  Do not disable the button, just prevent the second submit.

                  这个小脚本可以完成这项工作,但它假设在某个时刻有回发.

                  this little script does the job but it assumes there is a postback at a certain moment.

                  var formhandler = function() {
                     var submit, isSubmit = false;
                     submit = function(){
                                  // flop and return false once by the use of operator order.
                      return isSubmit != (isSubmit = true);
                      };
                      return {
                         submit: submit
                      };
                  }(); // <-- use direct invcation to keep the internal variables "static"
                  

                  附上:

                     document.forms[0].onsubmit = formhandler.submit;    
                  

                     OnClientClick = "formhandler.submit()";
                  

                  这篇关于多个提交按钮点击问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:ASP.NET OnClientClick="return false;"不工作 下一篇:如何取消winform按钮点击事件?

                  相关文章

                  最新文章

                  <i id='gPiHe'><tr id='gPiHe'><dt id='gPiHe'><q id='gPiHe'><span id='gPiHe'><b id='gPiHe'><form id='gPiHe'><ins id='gPiHe'></ins><ul id='gPiHe'></ul><sub id='gPiHe'></sub></form><legend id='gPiHe'></legend><bdo id='gPiHe'><pre id='gPiHe'><center id='gPiHe'></center></pre></bdo></b><th id='gPiHe'></th></span></q></dt></tr></i><div id='gPiHe'><tfoot id='gPiHe'></tfoot><dl id='gPiHe'><fieldset id='gPiHe'></fieldset></dl></div>

                    <small id='gPiHe'></small><noframes id='gPiHe'>

                    • <bdo id='gPiHe'></bdo><ul id='gPiHe'></ul>

                    1. <tfoot id='gPiHe'></tfoot>
                      <legend id='gPiHe'><style id='gPiHe'><dir id='gPiHe'><q id='gPiHe'></q></dir></style></legend>