has just completed a feature that jams today. In short, it is a delete operation that implements a checkbox multi-select value. I'm so busy that I finally got it done. JS as follows: (please leave a message if you do not understand)
function All_del () {
var selectitem = new Array ();
var coupon_id = $ ("#coupon_id"). Val ();
$ ("Input[name= ' key ']:checked"). each (function () {
Selectitem.push ($ (this). Val ());//append element to array
});
if (Selectitem.length = = 0) {
Alert (select the option you want to delete.) ");
} else {
$.ajax ({
Async:false,
URL: $ (' #cenurl '). Val () + "/home/coupon/all_del",
data:{' IDs ': Selectitem.join (","), ' c_id ': coupon_id},
Type: "POST",
DataType: "JSON",
Success:function (obj) {
if (obj.status==1)
{
alert (obj.info);
Window.location.href = Obj.jumpurl;
}else{
alert (obj.info);
}
}
});
}
}
Post-to-background data, is a string of two
Example: ids:1,2 and Id:3