Disabling Submit Button in ASP.NET 3.5 Application with JavaScript breaks BlackBerry submission
- by ahsteele
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?