Hi
I have an oscommerce site, but I need some help.
I have a problem with customers clicking the confirm order button twice, which then duplicates there order.
I have put in big letters
PLEASE CLICK THIS BUTTON ONCE but that doesnt work, they still double click
I got some javascript that is supposed to stop the button being clicked twice, but it doesn't work.
Can anyone give me some code that does work, or something that changes the button message to ..... processing please wait, or something similer
I have put the code below, where the button is, but Im not a programmer so not sure what I would need to change.
PHP Code:
<?php if (isset($$payment->form_action_url)) {
$form_action_url = $$payment->form_action_url;
} else {
$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
}
echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');
the code that doesnt work is this
[php]<script language="JavaScript">
<!--
var _submitted = false;
validate = function () {
_submitted = ( ! _submitted ) ? true : true ;
if ( _submitted ) document.getElementById( "checkout_confirmation" ).submit() ;
}
-->
</script>
echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER, ' onClick="validate();" ') . '</form>' . "\n";
if (is_array($payment_modules->modules)) {
echo $payment_modules->process_button();
}
echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
?>[/php]
I am absolutly desperate, so any help would be great