How to get FormData and form.serialize in data parameter on ajax jquery
<p>I have a form to upload a lot of information and a file multiupload uploader like this :</p>

<pre><code>&lt;div class="col-md-4"&gt;
 &lt;div class="form-group"&gt;
    &lt;label class="control-label col-md-3"&gt;Location&lt;/label&gt;
    &lt;div class="col-md-9"&gt;
        &lt;?php
        $location = array(
            "type" =&gt; "text",
            "name" =&gt; "location",
            "id" =&gt; "location",
            "class" =&gt; "form-control"
        );
        echo form_input($location);
        ?&gt;
        &lt;span class="help-block"&gt;&lt;/span&gt;
    &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;

&lt;div class="col-md-12"&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="control-label col-md-2"&gt;Warehouse&lt;/label&gt;
    &lt;div class="col-md-10"&gt;
        &lt;?php
        foreach ($tipe as $v):
            echo "&lt;label class='checkbox-inline'&gt;&lt;input type='checkbox' name='tipe[]' value='$v-&gt;ID_CHECK_LIST'&gt;$v-&gt;NAMA_CHECK_LIST&lt;/label&gt;";
        endforeach;
        ?&gt;
        &lt;p class="help-block"&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class="col-md-12"&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="control-label col-md-2"&gt;Image If Damage&lt;/label&gt;
    &lt;div class="col-md-4"&gt;
        &lt;input type="file" multiple="" name="images[]"&gt;
        &lt;p class="help-block"&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</code></pre>

<p></p>

<p>Now, I need to send them using ajax. I have try $(form).serialized(), but the $_FILES is empty, So I use FormData class. But FormData just handle the file, not the another input. How can I set the data in aja parameter to handle file and another input.</p>

<p>This is the ajax jquery</p>

<pre><code>$('#form').submit(function () {            
        $('#btnSave').text('saving...'); //change button text
        $('#btnSave').attr('disabled', true); //set button disable

        var url;
        var formData = new FormData(this);

        if (save_method === 'add') {
            url = "&lt;?php echo site_url('members/it/Request/ajax_add') ?&gt;";
        } else {
            url = "&lt;?php echo site_url('members/megumi/cek_list_wire_rod/ajax_update') ?&gt;";
        }

        // ajax adding data to database

        $.ajax({
            url: url,
            type: "POST",
            data: formData,
                processData: false,
                contentType: false,
                $('#form').serialize(),
            dataType: "JSON",
            success: function (data)
            {

                if (data.status) //if success close modal and reload ajax table
                {
                    $('#modal_form').modal('hide');
                    reload_table();
                } else
                {
                    for (var i = 0; i &lt; data.inputerror.length; i++)
                    {
                        $('[name="' + data.inputerror[i] + '"]').parent().parent().addClass('has-error'); //select parent twice to select div form-group class and add has-error class
                        $('[name="' + data.inputerror[i] + '"]').next().text(data.error_string[i]); //select span help-block class set text error string
                    }
                }
                $('#btnSave').text('Save'); //change button text
                $('#btnSave').attr('disabled', false); //set button enable
            },
            error: function (jqXHR, textStatus, errorThrown)
            {
                alert('Error adding / update data');
                $('#btnSave').text('save'); //change button text
                $('#btnSave').attr('disabled', false); //set button enable

            }
        });
        return false;
    });
</code></pre>

<p>Any help it so appreciated.</p>