views:

38

answers:

1

Hi, noob question: I'm building a checkout system for an online commerce site. I'm getting the bug where clicking on the "place order" button multiple times will place the order multiple times. I have an idea to load between the button-click page and place-order page with a page that waits several seconds before launching using javascript the place-order page.

My question is: what are some of the policies online for dealing with this particular scenario?

+4  A: 

The recommended practice is to:

  • Include a unique id on the order page
  • Disable the order button once it has been clicked
  • Check for the unique id in your serverside processing (make sure to handle race conditions)

There are lots of specific details to consider, but these heavily depend on your platform/framework of choice.

jsight