preventing users from submitting inputs twice

preventing users from submitting inputs twice

am 09.04.2008 13:06:30 von Ned White

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: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)

let me know if you have any problem with the code


type=3D'button' value=3D'Processing ...' disabled=3D'disabled'
style=3D'visibility:hidden; position:absolute;z-index:1;' />