ajax 获取checkbox的值并提交
时间:2015-01-06 22:57:36
收藏:0
阅读:783
$(‘.but_delet_choice‘).click(function(){ //获取全选之外的checkbox var $check_boxes = $(‘input[type=checkbox][checked=checked][id!=check_all_box]‘); if($check_boxes.length<=0){ alert(‘您未勾选,请勾选!‘); return; } if(confirm(‘您确定要删除吗?‘)){ var array_push = new Array(); $check_boxes.each(function(){ array_push.push($(this).val()); }); $.ajax({ type:‘post‘, traditional :true, //序列化数据 url:‘/post/‘, data:{‘array_push‘:array_push}, success:function(data){ } }); } return false; });
原文:http://www.cnblogs.com/druids/p/4207074.html
评论(0)