Problem w/ disabling buttons after onclick on clientside

M

Michael Groeger

Hi all,

I want to disable a button after it's clicked on the clients side, so that
this cannot be clicked twice. I tried this with adding the "onclick"
attribute to the button and disable the button then in javascript. Then I
tried it using Page.RegisterOnSubmitStatement(), but when I then click the
button the Click event is not fired on server side.

Any ideas?

Regards,
Michael
 
S

S. Justin Gengo

Michael,

I have a javascript that does this. It's contained within a Javascript
component that I give away for free, including source code, on my website.
You may see a demo of this particular script and the others contained in the
component here: http://www.aboutfortunate.com?page=javascriptdemo.

The script goes a bit further by calling the .Net validation routines before
it disables the button so that if a page isn't valid the user doesn't wind
up stuck on the page. The downloadable source code is for VS 2003 .NET 1.1
(I haven't had time to upgrade it to 2.0 yet but am hoping to soon). But
even if you just want to use the one script or need to upgrade it you'll be
able to use the source code as an example to go by.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
M

Michael Groeger

Hi,

thanks for your reply. I think it's not exactly what I require. But I am
still evaluating it.

Regards,
Michael
 

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,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top