473,402 Members | 2,046 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,402 software developers and data experts.

Limiting User Clicks

This may sound like a stupid question. Perhaps there is a simple answer
that I am overlooking.

I need some method of preventing the user from clicking the submit
button multiple times that is supported across various browser
platforms. I've tried everything I can think short of a wi-fi enabled
electric shock collar for stupid user training.

DETAILS:
I have a web application that processes information submitted via a
form. The entire process takes a couple of seconds, and no matter how
many times I tell the user to "only click the submit button once", at
least 10% of the users still double-click the button because they don't
know the difference between a desktop icon and a web button. Or, they
are impatient and can't wait the 3 or 4 seconds it takes for the
processing to complete.

Nov 19 '05 #1
4 1067
why dont you put an Onclick event on the button and change button to
disabled (via javascript) and maybe the text of the button to "please
wait..." ?

regards,
Paul
"Elroyskimms" <el*********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
This may sound like a stupid question. Perhaps there is a simple answer
that I am overlooking.

I need some method of preventing the user from clicking the submit
button multiple times that is supported across various browser
platforms. I've tried everything I can think short of a wi-fi enabled
electric shock collar for stupid user training.

DETAILS:
I have a web application that processes information submitted via a
form. The entire process takes a couple of seconds, and no matter how
many times I tell the user to "only click the submit button once", at
least 10% of the users still double-click the button because they don't
know the difference between a desktop icon and a web button. Or, they
are impatient and can't wait the 3 or 4 seconds it takes for the
processing to complete.

Nov 19 '05 #2
Using server side scripting, the postback takes too long to prevent the
user from "double clicking" the button, like they do a Windows icon.

I read somewhere that client side Javascript usedto disable a button
only works in IE. Is that true?

Nov 19 '05 #3
Disabling any type of client-side intrinsic functionality is generally a bad
idea, not to mention an exercise in futility. Handling it is much better.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.

"Elroyskimms" <el*********@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Using server side scripting, the postback takes too long to prevent the
user from "double clicking" the button, like they do a Windows icon.

I read somewhere that client side Javascript usedto disable a button
only works in IE. Is that true?

Nov 19 '05 #4
I hope the following code will help.

In page_load event do :

(btnNew is the related button).
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim btn As HtmlInputButton;

btn = CType(btnNew, HtmlInputButton)

btn.Attributes.Add("onclick", _

String.Format("domyfunc();"))

If (Not IsPostBack) Then

....

end if

end sub
and in the html code of aspx :

....
<script>

function domyfunc()
{ var btn;
btn = document.getElementById("btnNew");
btn.disabled = true; // remember this line, that users could not click
twice on the button very fast.
alert("do something"); // do something of your own
btn.disabled = false; // remember this line
}

</script>

....
Know that every ASPx is basically HTML (but not vice versa).
Think that ASPx writes always the code behind.
When - when doing page_load.

The sample is on page load (before clicking any button), so time here is no
consuming (the event was calculated before you even see the page on the
client).

I am newbie in .NET, and I am asking this newsgroup also,
but I think this code is fine ,after I tested it.

Cheers :)
Nov 19 '05 #5

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

Similar topics

1
by: Daniel | last post by:
limiting access to files with asp.net is there any way i can make a file only accessible to certain users of my website? my files are to large to copy to a temp directory and they are of many...
5
by: randyelliott | last post by:
Good Day, I have a MS Access (Access 2000 now upgraded to 2003) database that tracks customer information. One function of this database is to create an encrypted license file for our software,...
4
by: N J | last post by:
Hi, I ahve developed a program using access and am distributing it using MDE's, I ahve had many requests for a demo. I was thinking of limiting the number of records to say 100? If anyone has...
0
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application...
1
by: Mossman | last post by:
Hello, I will discuss at a high level what is happening on an ASP.NET web page I developed a year ago in ASP.NET using Visual Studio 2003 and currently support. I have an ASP.NET web page...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
2
by: polocar | last post by:
Hi, suppose that you have a C# form with two buttons, that are the classical "btnOk" and "btnCancel" (besides them, of course in the form there can be many other controls). When the user clicks...
2
by: prakashwadhwani | last post by:
I've used Dbase/Clipper for years & Access for a little while now but Access doesn't seem to have any elegant solution to limiting the size of a text box ... i.e. the max number of characters that...
1
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
Hi, I am developing an application to use by PDA device (Windows Mobile 5.0) for a survey. The users should only have access to the application and should not be able to use other programs in PDA....
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.