Sanjeev

Sanjeev

  • NA
  • 28
  • 0

Disable a button

Jan 9 2007 5:05 PM


I have a Save button on a web page.
I want to disable the button when clicked, so that the user does not click it more than once, as the serevr side code is being processed.
i disabled the button by calling a javascript function -
 btnSave.Attributes.Add("onClick","return buttonDisabled();") ;

In the Javascript file i have -
 function disableButton()
 {
  var btnSave = document.getElementById('btnSave') ;
  btnSave.disabled = true ;
  return true ;
 }

since the button gets disabled my server side code(in C#) does not get executed.
thanks a lot for any kind of help