Recognizing double clicks

Recognizing double clicks

am 22.11.2009 06:30:25 von Skip Evans

Hey all,

Every site I've ever stuck a credit card into said "only click
once...". I just this requirement from a client.

a.System should recognize a duplicated click, so the message
in red “only click once” should be unnecessary.

Is this doable???

Has anyone on the list ever done this???
--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Recognizing double clicks

am 22.11.2009 06:34:58 von Skip Evans

It just dawned on me the button may be disabled right when
it's clicked to prevent a double submit?

Is that doable?

Skip

Skip Evans wrote:
> Hey all,
>
> Every site I've ever stuck a credit card into said "only click
> once...". I just this requirement from a client.
>
> a.System should recognize a duplicated click, so the message in red
> “only click once” should be unnecessary.
>
> Is this doable???
>
> Has anyone on the list ever done this???

--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Recognizing double clicks

am 22.11.2009 07:30:18 von Manuel Lemos

Hello,

on 11/22/2009 03:34 AM Skip Evans said the following:
> It just dawned on me the button may be disabled right when it's clicked
> to prevent a double submit?
>
> Is that doable?

This forms generation class can do exactly that. It generates Javascript
with form HTML that disables the form submit button while the form is
submitted. Then it enables the submit button again. If the user clicks
on the button again, an alert message appears asking whether the user
really wants to submit the form again.

http://www.phpclasses.org/formsgeneration

Here you can see a live example:

http://www.meta-language.net/forms-examples.html?example=tes t_form

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Recognizing double clicks

am 22.11.2009 08:10:11 von ahlin.hans

Write a function that generate a unique form id and one that checks if
it already has been submitted.
Store data that the script sends after a submit has been done in the
session array and if it is a re-submit just re-send the the data.

2009/11/22 Skip Evans :
> Hey all,
>
> Every site I've ever stuck a credit card into said "only click  once=
....". I
> just this requirement from a client.
>
> a.System should recognize a duplicated click, so the message in red =E2=
€œonly
> click onceâ€=9D should be unnecessary.
>
> Is this doable???
>
> Has anyone on the list ever done this???
> --
> ==================== =====
============
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
>  -- Kurt Vonnegut
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--=20
MvH / Hans Åhlin
Tel: +46761488019
http//www.kronan-net.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Recognizing double clicks

am 22.11.2009 14:36:41 von Phpster

Yep

Bastien

Sent from my iPod

On Nov 22, 2009, at 12:34 AM, Skip Evans wrote:

> It just dawned on me the button may be disabled right when it's =20
> clicked to prevent a double submit?
>
> Is that doable?
>
> Skip
>
> Skip Evans wrote:
>> Hey all,
>> Every site I've ever stuck a credit card into said "only click =20
>> once...". I just this requirement from a client.
>> a.System should recognize a duplicated click, so the message in re=20
>> d â€=9Conly click onceâ€=9D should be unnecessary.
>> Is this doable???
>> Has anyone on the list ever done this???
>
> --=20
> ==================== =====
============
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
> -- Kurt Vonnegut
>
> --=20
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Recognizing double clicks

am 22.11.2009 16:47:25 von TedD

At 11:30 PM -0600 11/21/09, Skip Evans wrote:
>Hey all,
>
>Every site I've ever stuck a credit card into said "only click
>once...". I just this requirement from a client.
>
>a.System should recognize a duplicated click, so the message in red
>"only click once" should be unnecessary.
>
>Is this doable???
>
>Has anyone on the list ever done this???

Yes. I have done this before.

Three things:

1. The Credit Card processing company should have "Duplicate
Suppression" turned ON. Contact them.

2. Use javascript to deactivate the Submit button after it's clicked.

3. Just in case the user has javascript disabled, then have your php
form generate a token and place that value in a session. That way,
upon a refresh (double click) you can check if the session contains
anything and if it does, then don't do anything.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Recognizing double clicks

am 22.11.2009 20:01:47 von Mark Kelly

Hi.

On Sunday 22 Nov 2009 at 05:34 Skip Evans wrote:
> It just dawned on me the button may be disabled right when
> it's clicked to prevent a double submit?
>
> Is that doable?

To mark a button as disabled after it has been clicked to prevent it being
clicked twice just add some simple code in the button (all on one line in case
it wraps):

onClick="this.disabled=true; this.value='Processing'; this.form.submit();"

However I would also do something server side (a unique ID for every form
served works well) to handle browsers that don't have javascript turned on.
Never rely on (or trust) code running on the client.

Cheers,

Mark


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php