Does not send to php anything. And When I tried to show results on form data it looks empty.
My Form:
<form id="uploadform1236-1" method="POST" enctype="multipart/form-data" onsubmit="uploadprove('uploadform1236-1', event, 'post.php?action=uploadprove');">
<input name="picture" id="file-upload1236-1" class="" type="file">
<input name="testx" id="xxx1" class="" value="test1236" type="text">
<button id="uploadbutton1236-1" class="btn btn-primary btn-sm" type="submit">ttt</button>
</form>
Javascript:
function uploadprove(id, e, url) {
e.preventDefault();
var uploadform = $('#' + id)[0];
var formData = new FormData(document.getElementById(id)); //also tried to put uploadform variable here
alert(uploadform.toSource()); // results are ({0:{},1:{},2:{}}) It sees that 3 elements in form
alert(formData.toSource()); // results are ({})
$.ajax({
url: url,
type: "POST",
data: formData,
ContentType: false,
ProcessData: false,
success: function (data) {
alert(data);
}
})
}