$('#edit').click(function(event) {
ajaxEdit();
});
var ajaxEdit = function() {
$.ajax({
url: 'functions.php',
type: 'POST',
dataType: 'html',
data: $('#edit-item').serialize()
})
.done(function() {
ajaxShow(section);
})
.fail(function() {
console.log("error");
});
}
<form action="" id="edit-item">
<input value="" name="id" type="hidden">
<input value="" name="name" type="text" placeholder="name">
<input type="file" name="picture" >
</form>
var ajaxEdit = function() {
var form_data = new FormData();
form_data.append('file', $('input[name=picture]').prop('files')[0]);
form_data.append('id', $('input[name=id]').val());
form_data.append('name', $('input[name=name]').val());
$.ajax({
url: 'functions.php',
type: 'POST',
dataType: 'html',
data: form_data
})
.done(function() {
ajaxShow(section);
})
.fail(function() {
console.log("error");
});
}