I have normal form along with dropzone.js
, images
and i am trying to submit it using Ajax.
This is what i have tried so far.
function add()
{
var data = $('#add').serializeArray();
var filenames = [];
$('.dz-preview .dz-filename').each(function() {
var names = $(this).find('span').text();
filenames.push({name: 'filename', value: names });
});
data.push(filenames);
}
Append works fine,but i got the response something like this.
I can get list of all form posted element by using $this->input->post('unit_id')
in controller
. How can i access this filename array?
Any help will be highly appreciated.