首页 > 代码库 > 单选多选post值到控制器处理

单选多选post值到控制器处理

<td>
  <label class="checkbox">
          <input type="hidden" name="orderBy" value=http://www.mamicode.com/"<?=$val[‘orderBy‘]?>" >
     <input class="check" name="houseIds[]" type="checkbox" value=http://www.mamicode.com/"<?=$val[‘parmaId‘]?>">
  </label>
</td>
$("#configplshenhe").bind("click",function(){
    var arr = [];
    var csrfToken = $(‘meta[name="csrf-token"]‘).attr("content");
    var arrvalue1=[];
    $("[name=‘feedIds[]‘].check").each(function(){

        if(this.checked){
            arr.push($(this).val());
            var tr=$(this).parents(‘tr‘);
            var arrvalue=http://www.mamicode.com/tr.find("#orderBy").val();
            arrvalue1.push(arrvalue);
            // console.log(arrvalue);


        }

    });
    if(arr.length == 0){
        layer.msg("逗我呢?您选中数据了?!");

        return false;

    }
    console.log(arr);console.log(arrvalue1);
    layer.confirm(‘你确定你要更新这些选中的数据?‘, function(index){

        $.ajax({
            url: confighandle,
            type: ‘post‘,
            data: {autoId: arr , orderBy:arrvalue1},

            success: function (data) {
                console.log(data);
                if(data=http://www.mamicode.com/=1){"操作成功");
                }else if(data=http://www.mamicode.com/=3) {"数据重复");
                }else {
                    layer.msg("操作失败");
                }
            }
        });
        //$(‘[name="delEsf"]‘).val(arr.join(","));alert("0o

        ;        // searchForm.submit();

    });

    //return false;

});

单选多选post值到控制器处理