Disabling a button but calling its server code

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi

I am trying to create an "Update" button for my form.

So far I have got it working fine, posting back and
updating the record. Great!

However, I now want to make it so that when a user
presses "Update", the caption changes to "Updating..."
and the button disables (to prevent multiple form
submissions).

I can change the caption of the button easily enough, but
if I try disabling the button the server code fails to
run. I suppose this kind of makes sense - why would you
want to run code for a disabled button - however, to
achieve what I want I DO NEED to run the code. I have
tried calling __doPostBack from the buttons onclick event
but this doesn't work.

Any ideas?

Thanks, Paul.
 
I've tried this but to no avail.

If I disable the button in jscript and then call
__doPostBack(xxx_Update) the update event still doesn't
get called.

Paul.
 
But you dont need to call the __dopostback for button. the button sends
the Form without __dopostback.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
Doug,

Looks pretty much like what I'm trying already. I'll take
another look at my code. Thanks for you help - its good
to get confirmation that its possible.

Best regards

Paul.
 
Try to disable the button with some delay. Instead of "disabled=true", try
"window.setTimeout('PartyEdit_Update.disabled=true', 100)"
 
Back
Top