$().ready(function() { $("#loading").ajaxStart(function(){ $(this).show(); }).ajaxStop(function(){ $(this).hide(); }); $("#jroxUpdateCartForm").validate(); $("#jroxUpdateCouponForm").validate(); $("#jroxEstimateShippingForm").validate ({submitHandler: function(form) { $(form).ajaxSubmit({ target: "#ajaxContent" });}} ); $("#jroxCartCountryDropdown").change(onSelectChange); }); function onSelectChange(){ var selected = $("#jroxCartCountryDropdown option:selected"); var output = ""; if(selected.val() != 0){ $.post("cart/load_regions", { id: $(this).val() }, function(data){ process(data); }, "json"); } } function process(j){ var options = ''; for (var i = 0; i < j.length; i++) { options += ''; } $("select#jroxCartRegionDropdown").html(options); } function RemoveCoupon(){ var answer=confirm("Sei sicuro di voler rimuovere il testo da questo coupon?") if(answer) { window.location.href="http://eshop.borse.it/cart/remove_coupon"; } }