spaceman Posted September 29, 2002 Share Posted September 29, 2002 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: http://www.oscommerce.com/forums/viewtopic.php?p=66058 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. Help! Link to comment Share on other sites More sharing options...
spaceman Posted September 29, 2002 Author Share Posted September 29, 2002 Doh! 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: http://www.dynamicdrive.com/dynamicindex11.../submitonce.htm ..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 if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") to this: if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset||tempobj.type.toLowerCase()=="image") Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.