$(document).ready(function(){
  $("input[name='ID_card']").click(function(){
    if($(this).prop("checked")==true){
   $(this).next("input[type='hidden']").val('1');
    }else{
     $(this).next("input[type='hidden']").val('0');
    }    
  });
});

解决方案 »

  1.   

    $(document).ready(function(){
      $("input[name='ID_card']").click(function(){
        if($(this).prop("checked")==true){
       $(this).next("input[type='hidden']").eq(0).val('1');
        }else{
         $(this).next("input[type='hidden']").eq(0).val('0');
        }    
      });
    });
      

  2.   

    根据你的需求,我觉得each函数比较适合你。比如:$(function(){
                    $("input[type='checkbox']").each(function(){
                        $(this).click(function(){
                            if($(this).attr("checked")){
                                $(this).next("input[type='hidden']").val('1');
                            }else{
                                $(this).next("input[type='hidden']").val('0');
                            }                 })          })
      

  3.   

    首先要纠正你一个错误,就是为什么非要用隐藏域呢,这个复选框除了有显示的作用外,本身就是带值的,可以表示0和1,选中为1,不选中为0,你就用这个就可以了<input type="checkbox" value="0" name="ID_card">