Disabling Submit Button in ASP.NET 3.5 Application with JavaScript breaks BlackBerry submission

Posted by ahsteele on Stack Overflow See other posts from Stack Overflow or by ahsteele
Published on 2010-04-12T22:44:03Z Indexed on 2010/04/12 22:52 UTC
Read the original article Hit count: 461

The following code is being used to disable a Submit button once it has been clicked. This works great on desktop browsers and most BlackBerry mobile browsers.

Submit.Attributes.Add("onclick", "javascript:this.disabled=true;" +
    ClientScript.GetPostBackEventReference(Submit, null));

Unfortunately, when using a BlackBerry Storm clicking the submit button causes the device to just reload the page. If I remove this code the Storm browser submits the page just fine. I need to disable the button when the browser is capable of doing so but do not want to affect browsers that are not JavaScript capable.

I realize I could add the jQuery framework and only attach the event client side, but am trying to look for the simplest fix (read least intrusive) as this is a legacy application. Any suggestions?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript