I am trying to use checkbox with Ajax. Without Ajax I have handle it.
Here is my Jquery code

```
$("#skillcat").click(function(e) {
    var submit_val = new Array();
    e.preventDefault();
     var ids = $('check_subjects input:checked')
           .map(function(){
             return this.value;
           }).get();

    $.ajax( {
    type : "POST",
    dataType : "json",
    url : "./wp-admin/admin-ajax.php",
    data : {
        action : 'each_category',
        check_subjects : ids
    },
    success : function(data) {
        alert(data);

        $('#accordion').html(data);

    }
    });
});

```

Here is my php code where button and checkbox is generated in serverside

```
foreach($subjects as $key=> $data){     
echo '<input type="checkbox" id="'. $data->id .'" value="'. $data->id .'" name="check_subjects[]">&nbsp;&nbsp;  '. $data->subject .'<br>';
}

```

Serverside I used to catch data from Post array

```
if(isset($_POST['check_subjects'])){
    //var_dump(check_subjects);
    $check_subjects  = implode(',', $_POST['check_subjects']);
    //echo '$check_subjects&nbsp;&nbsp;&nbsp;&nbsp;'. $check_subjects;
}

```

however when I run above codes, I notice that some data is sent to the server(via chrom developer tool). But I get null in alert box. I guess response is null becase data is not sent to server properly. I am not sure about the javasript code I use to passe the request to Ajax.

Can anybody explain where I have done the mistake?