Im my c# web project, users click a submit button for credit card payment
process.
On the web server side ( on ButtonClick_Event) the user's input(name,date,cc
number etc.) is processed and some transactional database processes are
taken based on the inputs.
My problem is, users may think that the button click did not work, so they
can click it again and again or they can refresh the all page by pressing
the F5 button.
And These actions can lead to two or more submissions, resulting in more
database records being added for the same payment request.
How can i prevent users from submitting inputs twice and refreshing the page
?
Thanks..
NED
Re: preventing users from submitting inputs twice
am 09.04.2008 13:19:48 von Matthijs Krempel
Hi Ned,
Maybe you can navigate away from the page and put a mechanism in place that
detects if a user allready inserted a payment record?
With kind regards,
Matthijs Krempel
"Ned White" schreef in bericht
news:O$22MHjmIHA.484@TK2MSFTNGP06.phx.gbl...
> Hi All,
>
> Im my c# web project, users click a submit button for credit card payment
> process.
> On the web server side ( on ButtonClick_Event) the user's
> input(name,date,cc number etc.) is processed and some transactional
> database processes are taken based on the inputs.
>
> My problem is, users may think that the button click did not work, so they
> can click it again and again or they can refresh the all page by pressing
> the F5 button.
> And These actions can lead to two or more submissions, resulting in more
> database records being added for the same payment request.
>
> How can i prevent users from submitting inputs twice and refreshing the
> page ?
>
> Thanks..
>
> NED
>
>
>
Re: preventing users from submitting inputs twice
am 09.04.2008 13:46:24 von Premium Plastics
on the click event disable the button
sender.Enabled = False
"Ned White" wrote in message
news:O$22MHjmIHA.484@TK2MSFTNGP06.phx.gbl...
> Hi All,
>
> Im my c# web project, users click a submit button for credit card payment
> process.
> On the web server side ( on ButtonClick_Event) the user's
> input(name,date,cc number etc.) is processed and some transactional
> database processes are taken based on the inputs.
>
> My problem is, users may think that the button click did not work, so they
> can click it again and again or they can refresh the all page by pressing
> the F5 button.
> And These actions can lead to two or more submissions, resulting in more
> database records being added for the same payment request.
>
> How can i prevent users from submitting inputs twice and refreshing the
> page ?
>
> Thanks..
>
> NED
>
>
>
Re: preventing users from submitting inputs twice
am 09.04.2008 15:06:57 von rossum
On Wed, 9 Apr 2008 14:06:30 +0300, "Ned White" wrote:
>Hi All,
>
>Im my c# web project, users click a submit button for credit card payment
>process.
>On the web server side ( on ButtonClick_Event) the user's input(name,date,cc
>number etc.) is processed and some transactional database processes are
>taken based on the inputs.
>
>My problem is, users may think that the button click did not work, so they
>can click it again and again or they can refresh the all page by pressing
>the F5 button.
>And These actions can lead to two or more submissions, resulting in more
>database records being added for the same payment request.
>
>How can i prevent users from submitting inputs twice and refreshing the page
>?
>
>Thanks..
>
>NED
>
Firstly put up an immediate response along the lines of "We have
received your submission. It will take a few seconds to process.
Please do not resend yout details or refresh this page." That tells
the customer that you have got the transaction and are working on it.
Once you have finished processing then put up a "Thank you for your
custom" response. Always give immediate feedback to the customer so
they know what is happening.
Secondly keep a record of all recent transactions and query if any
duplicates come up within say ten minutes.
rossum
Re: preventing users from submitting inputs twice
am 09.04.2008 15:49:06 von ignacio.machin
On Apr 9, 7:46=A0am, "ThatsIT.net.au" wrote:
> on the click event disable the button
>
> sender.Enabled =3D False
>
That does not work, that event is executed in the server, he needs
something that execute in the client.
Re: preventing users from submitting inputs twice
am 09.04.2008 15:54:09 von ignacio.machin
On Apr 9, 7:06=A0am, "Ned White" wrote:
> Hi All,
>
> Im my c# web project, users click a submit button for credit card payment
> process.
> On the web server side ( on ButtonClick_Event) the user's input(name,date,=
cc
> number etc.) is processed and some transactional database processes are
> taken based on the inputs.
>
> My problem is, users may think that the button click did not work, so they=
> can click it again and again =A0or they can refresh the all page by pressi=
ng
> the F5 button.
> And These actions can lead to two or more submissions, resulting in more
> database records being added for the same payment request.
>
> How can i prevent users from submitting inputs twice and refreshing the pa=
ge
> ?
>
> Thanks..
>
> NED
This is not as easy as it sounds problem, the main issue is that you
cannot disable the button cause it would disable the postback.
The solution I use is to have another hidden button and put it over
the submit button.
Here is the javascript I use for it, You have a button that needs to
position over your real button, for that you need to calculate the
position (FindPost)
On Apr 9, 9:06=A0am, rossum wrote:
> On Wed, 9 Apr 2008 14:06:30 +0300, "Ned White" wrote:
> >Hi All,
>
> >Im my c# web project, users click a submit button for credit card payment=
> >process.
> >On the web server side ( on ButtonClick_Event) the user's input(name,date=
,cc
> >number etc.) is processed and some transactional database processes are
> >taken based on the inputs.
>
> >My problem is, users may think that the button click did not work, so the=
y
> >can click it again and again =A0or they can refresh the all page by press=
ing
> >the F5 button.
> >And These actions can lead to two or more submissions, resulting in more
> >database records being added for the same payment request.
>
> >How can i prevent users from submitting inputs twice and refreshing the p=
age
> >?
>
> >Thanks..
>
> >NED
>
> Firstly put up an immediate response along the lines of "We have
> received your submission. =A0It will take a few seconds to process.
> Please do not resend yout details or refresh this page." =A0That tells
> the customer that you have got the transaction and are working on it.
> Once you have finished processing then put up a "Thank you for your
> custom" response. =A0Always give immediate feedback to the customer so
> they know what is happening.
>
> Secondly keep a record of all recent transactions and query if any
> duplicates come up within say ten minutes.
>
> rossum- Hide quoted text -
>
> - Show quoted text -
IMHO it's just better to disable the submit mechanism.
You could also use a sort of veil control
Re: preventing users from submitting inputs twice
am 09.04.2008 18:17:11 von Peter Morris
Look at paypal. They have a button which when clicked has JavaScript to
disable the button and then post the form.
Re: preventing users from submitting inputs twice
am 09.04.2008 18:21:37 von lasse
Ignacio Machin ( .NET/ C# MVP ) wrote:
> On Apr 9, 7:06 am, "Ned White" wrote:
>> Hi All,
>>
>> Im my c# web project, users click a submit button for credit card payment
>> process.
>> On the web server side ( on ButtonClick_Event) the user's input(name,date,cc
>> number etc.) is processed and some transactional database processes are
>> taken based on the inputs.
>>
>> My problem is, users may think that the button click did not work, so they
>> can click it again and again or they can refresh the all page by pressing
>> the F5 button.
>> And These actions can lead to two or more submissions, resulting in more
>> database records being added for the same payment request.
>>
>> How can i prevent users from submitting inputs twice and refreshing the page
>> ?
>>
>> Thanks..
>>
>> NED
>
> This is not as easy as it sounds problem, the main issue is that you
> cannot disable the button cause it would disable the postback.
> The solution I use is to have another hidden button and put it over
> the submit button.
> Here is the javascript I use for it, You have a button that needs to
> position over your real button, for that you need to calculate the
> position (FindPost)
Does that change the focus away from the button the user pressed? If
not, a quick tap on the enter key will resubmit, regardless of how much
you've stuffed on top of the button.
There is one for-sure way to prevent double-orders:
1. generate a unique id (guid) alongside the order process
2. keep the guid with the order on all pages, up to the submit button
3. prevent any order from being processed if the guid is already in the
"processed" list
Couple that with your visual change on the button, and you should be set.
--
Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Re: preventing users from submitting inputs twice
am 10.04.2008 02:13:09 von Premium Plastics
"Ignacio Machin ( .NET/ C# MVP )" wrote in
message
news:2455e088-6484-4fdc-b778-27c84b398ef5@t54g2000hsg.google groups.com...
On Apr 9, 7:46 am, "ThatsIT.net.au" wrote:
> on the click event disable the button
>
> sender.Enabled = False
>
That does not work, that event is executed in the server, he needs
something that execute in the client.
this.disabled = true
Re: preventing users from submitting inputs twice
am 10.04.2008 06:11:30 von notmyfirstname
Ned,
I never will make this at single step process. At least you need a step,
wherin the user can verify what his/her input was (withouth sending of
course confidential information) and then process "the already gotten
information" with a kind of process button only one time.
(And don't forget to tell that it is processed)
Just my thought, the implementation is yours.
Cor
"Ned White" schreef in bericht
news:O$22MHjmIHA.484@TK2MSFTNGP06.phx.gbl...
> Hi All,
>
> Im my c# web project, users click a submit button for credit card payment
> process.
> On the web server side ( on ButtonClick_Event) the user's
> input(name,date,cc number etc.) is processed and some transactional
> database processes are taken based on the inputs.
>
> My problem is, users may think that the button click did not work, so they
> can click it again and again or they can refresh the all page by pressing
> the F5 button.
> And These actions can lead to two or more submissions, resulting in more
> database records being added for the same payment request.
>
> How can i prevent users from submitting inputs twice and refreshing the
> page ?
>
> Thanks..
>
> NED
>
>
>
Re: preventing users from submitting inputs twice
am 11.04.2008 03:41:11 von Arne
Lasse Vågsæther Karlsen wrote:
> There is one for-sure way to prevent double-orders:
>
> 1. generate a unique id (guid) alongside the order process
> 2. keep the guid with the order on all pages, up to the submit button
> 3. prevent any order from being processed if the guid is already in the
> "processed" list
>
> Couple that with your visual change on the button, and you should be set.
That is indeed the way to do it.
It is known as Synchronizer Token Pattern or just Token Pattern.