码迷,mamicode.com
首页 > Web开发 > 详细

ajax 获取checkbox的值并提交

时间:2015-01-06 22:58:40      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:

$(‘.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;  
            });                              

 

ajax 获取checkbox的值并提交

标签:

原文地址:http://www.cnblogs.com/druids/p/4207074.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!