I want to my user can upload image with post. So with every reply form have a upload form also. User can upload a image by click upload button and then click submit to submit po
You might need to reset the file form:
$("form.upload_Reply")[0].reset();
$("form.upload_Reply").trigger("reset");
Also, you can get more debugging information from your AJAX call. Try writing error/success data to the console:
$('.upload_Reply').on('submit', function(e){
e.preventDefault();
var EID = $(this).attr('id');
$('.loading').show();
$.ajax({
type:"post",
url:"../upload.php",
data: new FormData(this),
contentType: false,
cache: false,
processData:false,
success: function(response, statusText, xhr){
console.log(response);
console.log(statusText);
console.log(xhr);
$('#img'+ EID).attr('value', response);
},
error: function(xhr, statusText, errorThrown){
console.log(errorThrown);
console.log(statusText);
console.log(xhr);
},
});
return false;
});