0
 <form action="<?php echo Mage::getUrl('abc_checkout/cart/placeorder'); ?>" method="post" id="confirm_order_form" class="info-static" onsubmit="return submitOrder();">
.
.
.
.

    <div class="buttons-set">
    <p class="back-link"><span onclick="history.go(-1);
                    return true;" class="engine-btn">Back</span></a></p>
    <button type="submit" title="<?php echo $this->__('Place your order') ?>" class="engine-btn continue"><span><span><?php echo $this->__('Place your order') ?></span></span></button>
    <div class="mt30">
        <?php echo $this->__('Please be patient.'); ?>
    </div>
</div>
</form>

I want to disable this submit button after one click on front end.

3 Answers 3

2

use jquery for disable button

$(function(){
 $(".engine-btn").click(function () {
   $(".engine-btn").attr("disabled", true);
   $('#yourFormId').submit();
 });
});
2

on the <button> tag add "onclick"="jQuery(this).disabled = true;"

1

jQuery now has the .one() function that limits any given event (such as "submit") to one occurrence.

For Example:

$('#myForm').one('submit', function() {
    $(this).find('input[type="submit"]').attr('disabled','disabled');
});

I hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.