Question: here's my ajax

```
        var data = {
            user_id : <?php echo $this->session->userdata('id') ?>,
            no_s0 : $('#no_so').val(),
            catatan : $('#remarks').val(),
            kode_barang : $('#kode_barang').val(),
            nama_toko : $('input[id="nama_toko"]').map(function(){return $(this).val()}).get(),
            pcs : $('input[id="pcs"]').map(function(){return $(this).val()}).get(),
            diskon : $('input[id="diskon"]').map(function(){return $(this).val()}).get()
        }

$.ajax({
            url : '<?php echo base_url('sales_so/input') ?>',
            type : 'POST',
            data : data,
            error : function(){
                alert('gagal')
            },
            success : ()=>{
                alert('berhasil')
            }
        })

```

the status code is 200, and it worked fine. the problem is that i did not get any data from this. I tried to var\_dump the data, but it give me this : array(0) { }

here's my controller :

```
$post = $this->input->post();
var_dump($post);

```

edit : please help, i still can't find the solution.

Answer: 
You can use serializeArray

`fields = $ ("#element").serializeArray();`
sorry about my english,

I assume the data you want to send comes from form submit, if true, it could be simple like this

```
var form = new FormData($("#id_form")[0]); // make sure to use the id on the form
$.ajax({  
type: "POST",  
url:  <?php echo base_url('sales_so/input') ?>, 
data: form,  
processData: false,
contentType: false,
success: function(result){
    console.log(result); // for debugging can be seen on the console. or you can also use alert alert('sukses');
}
});

```

in controller try to var\_dump the result

Thanks.