Disabling a button but calling its server code

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.
 
P

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.
 
N

Natty Gur

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
 
P

Paul

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.
 
H

Hristo Ivanov [MS]

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top