Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

disable confirm order button after click?


GoTTi

Recommended Posts

im sure it is somewhere here, but ofcourse i can't find it....

 

how would i disable the confirm order button during checkout after a customer enters their cc informaiton one time and clicks it so we dont have multiple clicks and charges possibly having on that button?

 

thanks

Link to comment
Share on other sites

A couple ways to go about it..

 

I personally would use Client side scripting if it was an issue, though I have never found it to be.

 

You could use a timer or a hide function. Try searching for "javascript disable button after click"

 

Here is one example of hiding the button:

<script type="text/javascript">
   onclick = function() {
       var chk= document.getElementById('TheButtonIDhere');
       chk.style.display="none"; 
   };
</script>

Link to comment
Share on other sites

<script language="JavaScript" type="text/javascript">

function formValidator(){

var f_button = document.checkout_confirmation.Button;

f_button.disabled='true';

hidden_span = document.getElementById('hide_stuff');

hidden_span.style.display = 'block';

document.checkout_confirmation.submit();

}

</script>

<input type="button" name="Button" value="Confirm Order" onClick="formValidator()"/>

<br><br>

<div id="hide_stuff" style="display: none;">

<table align="center">

<tr>

<td valign=middle><img src="LoadingGraphic.gif" /></td>

<td valign=middle><b><span class="largeText">Processing...</span></b></td>

</tr>

</table>

<p><b>PLEASE BE PATIENT—THIS MAY TAKE SEVERAL SECONDS.<br>ONCE COMPLETED, YOU WILL SEE A CONFIRMATION MESSAGE.</b></p>

</div>

<strong>CLICK THE "Confirm Order" BUTTON ONE TIME.<br>

CLICKING THIS MORE THAN ONCE WILL RESULT IN MULTIPLE PAYMENTS. </strong>

<br> By click on the confirmation button, you agree to the terms and conditions.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...