一個計算價格的函數
function countprice()
{
$.ajax({
beforeSend:function(){$("#msg").addClass("msg").html("提交計算");},
type: "post",
url:"ajax.aspx?act=count&n="+Math.random(),
data:$("#CBL_XQ input[type=checkbox]").serialize()+"&Address1_1="+$("#Address1_1").val()+"&Address2_1="+$("#Address2_1").val(),
success: function(count){
if(count==0){
$("#Price").html("價格不能為 0");
$("#sendinfo").attr("disabled","disabled");
}
else
{
$("#kd_price").val(count);
$("#SumPrice").html("價格:"+count);
$("#lbl_price").html("稅金:"+Math.ceil(count*0.05));
$("#Price").html("<br />總金額(含稅):"+Math.ceil(count*1.05));
$("#sendinfo").attr("disabled","");
}
},
error:function(){
$("#kd_price").val("");
$("#SumPrice").html("");
$("#lbl_price").html("");
$("#Price").html("暫不服務");
$("#sendinfo").attr("disabled","disabled");
}
});
}
{
$.ajax({
beforeSend:function(){$("#msg").addClass("msg").html("提交計算");},
type: "post",
url:"ajax.aspx?act=count&n="+Math.random(),
data:$("#CBL_XQ input[type=checkbox]").serialize()+"&Address1_1="+$("#Address1_1").val()+"&Address2_1="+$("#Address2_1").val(),
success: function(count){
if(count==0){
$("#Price").html("價格不能為 0");
$("#sendinfo").attr("disabled","disabled");
}
else
{
$("#kd_price").val(count);
$("#SumPrice").html("價格:"+count);
$("#lbl_price").html("稅金:"+Math.ceil(count*0.05));
$("#Price").html("<br />總金額(含稅):"+Math.ceil(count*1.05));
$("#sendinfo").attr("disabled","");
}
},
error:function(){
$("#kd_price").val("");
$("#SumPrice").html("");
$("#lbl_price").html("");
$("#Price").html("暫不服務");
$("#sendinfo").attr("disabled","disabled");
}
});
}
Some people have some things
see you leave
