I'd like to disable a submit button to prevent mutiple database entries.
I've not had a problem disabling the button using Javascript but the method i used seems to intercept the postback and so the normal code is never executed. I found out i had to manually post the form, with this the form is submitted and page_load runs but i still can't get the button_onclick event to run after the button is disabled. code.....
VB Code:
  1. 'In code behind
  2. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3.     If Not IsPostBack Then
  4.         btnSubmit.Attributes.Add("onclick", "return disableMe(this);")
  5.     End If
  6. End Sub
  7.  
  8. Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
  9.     'Fairly long process here
  10. End Sub
  11.  
  12. 'In Script in .aspx file
  13.         <script language="javascript">
  14.             function disableMe(btn) {
  15.                 btn.disabled = true;
  16.                 document.form1.submit();
  17.                 return true;
  18.             }
  19.         </script>
I've found quite a few examples on the web but couldn't get any of them to work.

any ideas?