473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem w/ disabling buttons after onclick on clientside

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
Jan 11 '06 #1
2 1363
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
"Michael Groeger" <go*********@web.de> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
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

Jan 11 '06 #2
Hi,

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

Regards,
Michael

"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> schrieb im
Newsbeitrag news:#s**************@tk2msftngp13.phx.gbl...
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
"Michael Groeger" <go*********@web.de> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
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


Jan 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: KS | last post by:
I write my html pages as .jsp files (java server pages). The final result when the page is rendered in the browser, and I do a view source, is nothing less the normal HTML codes. The problem is I...
16
by: Ralph Freshour | last post by:
How can I disable a button once it has been clicked? I want to prevent the user from clicking on it twice if they have a slow connection. Thanks...
2
by: Matt | last post by:
The ASP page has multiple buttons, and when the user clicks different buttons, it will submit the form data to different URLs. My first approach was to use BUTTON type, and triggers javascript...
3
by: inonzuk | last post by:
Hi everyone, I'm new to javascript and have the following problem: I have two image buttons: 1) <td><a href="http://localhost/gamerules.php" target="mainwindow"><img onMouseOver="return...
3
by: Avlan | last post by:
Hi all, I'm pretty new at asp-coding, but I'm getting stuff to work. I now have the problem that, after someone has made a query, returning, say, 10 contacts (name/addresses in a simple...
1
by: mssbass | last post by:
In order to disable the previous and next buttons on my form, I followed the attached code. The buttons seem to work fine except for one thing. When the form first opens, the next button is...
5
by: Rabel | last post by:
I am a flash designer so I dont know a whole lot about the javascript submit buttons (I may not even be describing it right sorry) but here is the code I am using. <IMG name="Checkout"...
8
by: Willie | last post by:
Hi All; I have a form with multiple buttons and I would like to disable the buttons after the user clicks on the button to prevent multiple submitions. <input type="submit" name="return1"...
20
by: Geoff Cox | last post by:
Hello, I am not at clear how to tackle this one. Say the note middle C is played, just once. Then when the user clicks on a play image a series of notes are played starting with middle C...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.