zoukankan      html  css  js  c++  java
  • button 只能提交一次

    <asp:Button ID="Button1" runat="server" Text="· 提 交 ·" onclick="Button1_Click" UseSubmitBehavior="false" OnClientClick="clickOnce(this, 'Cargando...')"/>
    
     
    
    <script type="text/javascript" language="javascript">
        function clickOnce(btn, msg) {
            // 验证是否做了验证
            if (typeof (Page_ClientValidate) == 'function') {
                // if we are doing a validation, return if it's false 
                if (Page_ClientValidate() == false) { return false; }
            }
            // Ensure that the button is not of type "submit"
            if (btn.getAttribute('type') == 'button') {
                // The msg attibute is absolutely optional
                // msg will be the text of the button while it's disabled
                if (!msg || (msg = 'undefined')) { msg = '提交中...'; }
                btn.value = msg;
                // The magic :D
                btn.disabled = true;
            }
            return true;
        }
    </script>
  • 相关阅读:
    python调用ggsci.exe程序
    confluence安装
    nginx优化
    ELKstack搭建
    zabbix 安装
    python requests
    小程序消息推送
    shell
    rar 解压
    ubuntu 安装部分设置U盘启动系统安装盘操作
  • 原文地址:https://www.cnblogs.com/shuyu/p/1704729.html
Copyright © 2011-2022 走看看