View Single Post
  #1 (permalink)  
Old 03-03-2007, 01:25 PM
reachpradeep's Avatar   
reachpradeep reachpradeep is offline
Learning Programmer
 
Join Date: Mar 2007
Location: India
Posts: 41
Rep Power: 7
reachpradeep is on a distinguished road
Send a message via MSN to reachpradeep
Default Disable a button

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
Reply With Quote

Sponsored Links