简体   繁体   中英

Disable the submit button after sending

I have a problem in a containing page commands to send, when I click the button (Send command) it may take a while, depending on the size of it. So I want to disable "Send order" to prevent user to resend. Here is the aspx code button "send order"

<wuc: SexyButton ID = "btnEnvoyerCmd" runat = "server" CssClass = "nv_boutonRouge"      onclick = "BtnEnvoyerCmd_Click" OnClientClick = "ShowLoadingPanel ();" /> 

and the javascript showloadingPanel ()

ShowLoadingPanel function () {

        if (arguments.length == 0) {
         / / No arguments -> text normal loading 
         if (_aspxIsExists (LoadingPanel)) {
             LoadingPanel.Show (); 
         } 
     } 
     else {
         / / Argument -> loading text specified 
         if (_aspxIsExists (LoadingPanelCustomText)) {
             LoadingPanelCustomText.SetText (arguments [0]); 
             LoadingPanelCustomText.Show (); 
         } 

         } 
    } 
                 

So I need your help, do you have any idea?

Thank you in advance :)

On server side function you can do at function start

btnEnvoyerCmd.Enaled=false;

or you can do it on client side using this code

var button = document.getElementById('yourButton');
button.disabled = true;

Hope this will help

在Jquery中,您可以这样禁用它:

$('#btnEnvoyerCmd').addAttr('disabled','disabled')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM