0
Reply

Disable a button

Sanjeev

Sanjeev

Jan 9 2007 5:05 PM
2.1k


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