473,379 Members | 1,544 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,379 software developers and data experts.

How To Stop Students From Clicking Twice

We need to stop students from clicking on the form button more than once.

We have a form that students fill out with their credit card information.
They click, the form sends the data in xml to Bank of America, theres a
short wait, BofA sends back some xml, and on to the next page.

Sometimes, though, BofA is slow and the students get impatient, clicking
twice or even more. They get charged each time they click.

We have a warning that says, 'Click only once' but students don't heed it.

Any ideas?
Nov 18 '05 #1
10 2525
you can disable the button on click. either you can choose to write the code
for that or you download the same (if someone is kind enough to do it for
you)
have a look at
http://aspzone.com/archive/2004/01/06/292.aspx

i have used it in past and it works great. Check the demo. if you like what
you see.. download the project compile it and use the oneclickbutton instead
of normal button

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Jim Bayers" <sp**@spamity.spam> wrote in message
news:Xn*****************************@207.46.248.16 ...
We need to stop students from clicking on the form button more than once.

We have a form that students fill out with their credit card information.
They click, the form sends the data in xml to Bank of America, theres a
short wait, BofA sends back some xml, and on to the next page.

Sometimes, though, BofA is slow and the students get impatient, clicking
twice or even more. They get charged each time they click.

We have a warning that says, 'Click only once' but students don't heed it.

Any ideas?

Nov 18 '05 #2
> We have a warning that says, 'Click only once' but students don't heed it.

On the first click, immediately direct them to a new page while you wait for
the data to return.

Even then, you're going to get some folks that instinctively double-click.
The best bet is to write code to check for that. Log the first click and
then on each click, check to see that there isn't one already submitted in
the last X seconds with the same data. If so, ignore it.

-Darrel
Nov 18 '05 #3
Here are a couple similar techniques to prevent users from getting too click
happy:
http://aspzone.com/articles/207.aspx

http://aspzone.com/archive/2004/01/06/292.aspx
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"Jim Bayers" <sp**@spamity.spam> wrote in message
news:Xn*****************************@207.46.248.16 ...
We need to stop students from clicking on the form button more than once.

We have a form that students fill out with their credit card information.
They click, the form sends the data in xml to Bank of America, theres a
short wait, BofA sends back some xml, and on to the next page.

Sometimes, though, BofA is slow and the students get impatient, clicking
twice or even more. They get charged each time they click.

We have a warning that says, 'Click only once' but students don't heed it.

Any ideas?

Nov 18 '05 #4
Good rule of thumb: NEVER count on your users to do what they are supposed
to do. Students, teachers, and Joe SixPack alike, humans are unreliable and
unpredictable. Anything in your app that is necessary to be done should be
done BY your app.

IOW, you can't stop it. Therefore, you handle it. You write code into your
app that handles the event of a user clicking a button twice. Some solutions
include:

1. After clicking once, disable or hide the button. This can be done
server-side or client-side. Best to do it on the server, so as to survive
postbacks.
2. Use a server-side persistent value (ViewState or SessionState) that is
set the first time the user clicks the button. Check that value to see
whether the button has already been clicked prior to executing the business
logic that you don't want repeated.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Jim Bayers" <sp**@spamity.spam> wrote in message
news:Xn*****************************@207.46.248.16 ...
We need to stop students from clicking on the form button more than once.

We have a form that students fill out with their credit card information.
They click, the form sends the data in xml to Bank of America, theres a
short wait, BofA sends back some xml, and on to the next page.

Sometimes, though, BofA is slow and the students get impatient, clicking
twice or even more. They get charged each time they click.

We have a warning that says, 'Click only once' but students don't heed it.

Any ideas?

Nov 18 '05 #5
Jim Bayers <sp**@spamity.spam> wrote in
news:Xn*****************************@207.46.248.16 :
We have a form that students fill out with their credit card
information. They click, the form sends the data in xml to Bank of
America, theres a short wait, BofA sends back some xml, and on to the
next page.


Can you do an asyncronous process?

Submit the form and redirect the students to a thank you page.

In the background process the CC transaction. If there is a failure, e-mail
the student?

This way you can reduce double clicks drastically.

Someone else mentioned disabling the submit button. This works as well but
doesn't prevent double clicks (i.e. If the student has javascript
disabled).
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #6
> 1. After clicking once, disable or hide the button. This can be done
server-side or client-side. Best to do it on the server, so as to survive
postbacks.


Its interesting for me, how are you going to do this server side?

When the user clicks on button, a post request is initiated by
the browser. Until the response from server arrived you have OLD PAGE
IN YOUR BROWSER WITH ENABLED BUTTON - you can press the button again.

Such issues must be done ONLY client side. Write a javascript function
which will set IFRAME over all other objects with message "Please wait"
inside, and make so that it is invoked when the button clicked.

Nov 18 '05 #7
You made a good point. I will change my recommendation to "both client and
server-side" - client-side for immediacy, and server-side for surviving
PostBacks.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Ihor Bobak" <Ihor Bo***@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
1. After clicking once, disable or hide the button. This can be done
server-side or client-side. Best to do it on the server, so as to survive postbacks.


Its interesting for me, how are you going to do this server side?

When the user clicks on button, a post request is initiated by
the browser. Until the response from server arrived you have OLD PAGE
IN YOUR BROWSER WITH ENABLED BUTTON - you can press the button again.

Such issues must be done ONLY client side. Write a javascript function
which will set IFRAME over all other objects with message "Please wait"
inside, and make so that it is invoked when the button clicked.

Nov 18 '05 #8

OneClick Control

http://www.metabuilders.com/Tools/OneClick.aspx

"Jim Bayers" <sp**@spamity.spam> wrote in message
news:Xn*****************************@207.46.248.16 ...
We need to stop students from clicking on the form button more than once.

We have a form that students fill out with their credit card information.
They click, the form sends the data in xml to Bank of America, theres a
short wait, BofA sends back some xml, and on to the next page.

Sometimes, though, BofA is slow and the students get impatient, clicking
twice or even more. They get charged each time they click.

We have a warning that says, 'Click only once' but students don't heed it.

Any ideas?


Nov 18 '05 #9
That is a nice Control!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:O4**************@TK2MSFTNGP14.phx.gbl...

OneClick Control

http://www.metabuilders.com/Tools/OneClick.aspx

"Jim Bayers" <sp**@spamity.spam> wrote in message
news:Xn*****************************@207.46.248.16 ...
We need to stop students from clicking on the form button more than once.
We have a form that students fill out with their credit card information. They click, the form sends the data in xml to Bank of America, theres a
short wait, BofA sends back some xml, and on to the next page.

Sometimes, though, BofA is slow and the students get impatient, clicking twice or even more. They get charged each time they click.

We have a warning that says, 'Click only once' but students don't heed it.
Any ideas?

Nov 18 '05 #10
Ihor Bobak wrote:
1. After clicking once, disable or hide the button. This can be done
server-side or client-side. Best to do it on the server, so as to survive
postbacks.

Its interesting for me, how are you going to do this server side?

When the user clicks on button, a post request is initiated by
the browser. Until the response from server arrived you have OLD PAGE
IN YOUR BROWSER WITH ENABLED BUTTON - you can press the button again.

Such issues must be done ONLY client side. Write a javascript function
which will set IFRAME over all other objects with message "Please wait"
inside, and make so that it is invoked when the button clicked.


There is a way to do it. When the page posts back the first time,
disable the button. Then, register a client side script to immediately
post back again (theForm.submit()).

If the controls are written with viewstate in mind, they should retain
all of the data that the user entered.
Nov 18 '05 #11

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

Similar topics

2
by: Earl T | last post by:
I am using IE only for this control I am building. I have created a rich text box that the user can popup (using dhtml and a div tag) to allow the user to enter wiziwig html text. However, when the...
2
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely...
3
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
6
by: John (Z R) L | last post by:
Hi all, I am very new to programming, and I chose to study the Python language before C++. I am currently using the Wikibooks "Non-Programmer's Tutorial for Python", and am up to the section "Who...
0
by: csgraham74 | last post by:
Hi, I have a weird problem that is happening on my ASP.Net (1.1) web application. I have built a page that has a button control. Basiaclly this performs a search using a datarow. The problem is...
3
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, In my web form i have problem that I have to click twice a button for the code behind to be executed!!!? Why!?
1
by: jonkemm | last post by:
I'm making a a system for my school to allow students to have some online space to store their school files on. It has a basic upload / create folder / download / delete bit, it also has a 'submit...
3
by: Lowrider | last post by:
I'm new to the VB programming world and am having a problem with flow control. In the code below I check 3 textboxes and display a messagebox if one or more are left blank. The problem lies in that...
2
by: fran7 | last post by:
Hi, I have this very nice link tracker script that works a treat. The only thing is it doesnt restrict repeat clicking. Is there a simple method to add a cookie feature to this so that people...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.