Prevent double form submission. Closes #1609.

This commit is contained in:
Mike Jolley 2012-10-17 12:21:50 +01:00
parent 0d38e61e2d
commit c1c5cd6890
2 changed files with 6 additions and 1 deletions

View File

@ -45,4 +45,9 @@ jQuery(document).ready(function($) {
}
});
// prevent double form submission
$('form.cart').submit(function(){
$(this).find(':submit').attr( 'disabled','disabled' );
});
});

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e(".woocommerce_tabs .panel").hide();e(".woocommerce_tabs ul.tabs li a").click(function(){var t=e(this),n=t.closest(".woocommerce_tabs");e("ul.tabs li",n).removeClass("active");e("div.panel",n).hide();e("div"+t.attr("href")).show();t.parent().addClass("active");return!1});e(".woocommerce_tabs").each(function(){var t=window.location.hash;t.toLowerCase().indexOf("comment-")>=0?e("ul.tabs li.reviews_tab a",e(this)).click():e("ul.tabs li:first a",e(this)).click()});e("#rating").hide().before('<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>');e("p.stars a").click(function(){var t=e(this);e("#rating").val(t.text());e("p.stars a").removeClass("active");t.addClass("active");return!1});e("#review_form #submit").live("click",function(){var t=e("#rating").val();if(e("#rating").size()>0&&!t&&woocommerce_params.review_rating_required=="yes"){alert(woocommerce_params.required_rating_text);return!1}})});
jQuery(document).ready(function(e){e(".woocommerce_tabs .panel").hide();e(".woocommerce_tabs ul.tabs li a").click(function(){var t=e(this),n=t.closest(".woocommerce_tabs");e("ul.tabs li",n).removeClass("active");e("div.panel",n).hide();e("div"+t.attr("href")).show();t.parent().addClass("active");return!1});e(".woocommerce_tabs").each(function(){var t=window.location.hash;t.toLowerCase().indexOf("comment-")>=0?e("ul.tabs li.reviews_tab a",e(this)).click():e("ul.tabs li:first a",e(this)).click()});e("#rating").hide().before('<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>');e("p.stars a").click(function(){var t=e(this);e("#rating").val(t.text());e("p.stars a").removeClass("active");t.addClass("active");return!1});e("#review_form #submit").live("click",function(){var t=e("#rating").val();if(e("#rating").size()>0&&!t&&woocommerce_params.review_rating_required=="yes"){alert(woocommerce_params.required_rating_text);return!1}});e("form.cart").submit(function(){e(this).find(":submit").attr("disabled","disabled")})});