Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

How to stop multiple order/payment submissions?


Recommended Posts

OK, so I'm being a bit cheeky here by posting this topic again in a busier forum because I've not yet got any joy from a less busy (but probably more appropriate) forum:




To summarise - I'm trying to implement a javascript solution in my implementation of osCommerce that will prevent the possibility of the final 'Confirm Order' button being clicked more than once by an impatient customer. Otherwise they might pay twice (or more times) by accident.


All javascript solutions (about 3) I have tried have failed. No errors - they just don't work.


Until I get this fixed, my payment gateway provider won't allow my site to go live. That's fair enough, but I just didn't expect to be frustrated at the final hurdle by a couple of lines of easy javascript that just won't work as expected.



Link to comment
Share on other sites



I made 'one of those errors' where a second pair of eyes (thanks Nick!)was able to spot the stupid error immediately. I was putting the onsubmit attribute inside the submit tag, and not the form tag. Double doh! :oops:


HOWEVER, even then the only javascript script I was able to get working to my complete satisfaction was the one from Dynamic Drive:




..and then only after I changed the 'Complete Order' button from a graphic to a regular HTML <input type='submit...> tag.


The Dynamic Drive code disables the submit button after it's been clicked, The submit button (after clicking) is actually greyed-out - this helps to reinforce the message better than using an image as the button, because of course an image submit button can't be greyed out after clicking it. But I should point out that I couldn't get the Dynamic Drive script working with the image submit button even after I changed this




to this:



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...