This is what we do:
When a user clicks 'add to cart' the button is disabled and the box is greyed out. A ' loading.gif ' is displayed onto the page during an Ajax request. When this Ajax request is over the button is re-enabled and the ' loading.gif ' is once again hidden. The cart on the page is then updated and a 'successfully added to cart' message is displayed to the user.
This way the user gets feedback about their actions -- and the consequence of that exact action.
Below is an example of a javascript function that will disable it's own button, display a "loading .gif" for the user, submit the form, and reenable itself once it's execution is complete:
<script type="text/javascript">
productAddToCartForm.submit = function (button, url) {
var data = jQuery('#product_addtocart_form').serialize();
data += '&isAjax=1';
//this shows a small .gif that tells the user a process is taking place
jQuery('#ajax_loader').show();
//this disables the add to cart button
jQuery('#buttonAddToCart').prop("disabled", true);
try {
jQuery.ajax({
url: url,
dataType: 'json',
type: 'post',
data: data,
success: function (data) {
//this hides the processing .gif
jQuery('#ajax_loader').hide();
//this removes the 'disable' on the add to cart button
jQuery('#buttonAddToCart').prop('disabled', false);
}
});
} catch (e) {
}
this.form.action = oldUrl;
}
}
}
</script>