471,078 Members | 822 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 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 2429
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Imran Aziz | last post: by
reply views Thread by csgraham74 | last post: by
3 posts views Thread by =?Utf-8?B?QmFkaXM=?= | last post: by
reply views Thread by leo001 | last post: by

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.