0

Hello I'm trying to prevent double click on a button with javascript plus aspnet application but it seems not working does anyone know what is the problem? here my code

asp.net

<asp:Button ID="SalvarArquivo" Class="btn btn-primary col-xs-5 cancel" Text="Enviar Arquivo" runat="server" OnClick="SalvarArquivo_Click" OnClientClick="BloquearBotao(this);" UseSubmitBehavior="false"/>

javascript funciont

function BloquearBotao(botao) {
        botao.disable = true;
        return true;}

2 Answers 2

0

Good afternoon, I think that you need to make a slight modification to your BloquearBotao function:

 function BloquearBotao(botao) {
    botao.disabled = true;
    return true;
 }
Sign up to request clarification or add additional context in comments.

Comments

0

Try using jquery:

 $(document).dblclick(function (e) {
        e.preventDefault();
    });

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.