0
$(document).on('beforeSubmit','#notes-comments-form',function(e){
e.preventDefault(); //STOP default action
var url = $(this).attr('action'); 
$(this).ajaxSubmit({
    url: url,
    type: 'POST',
    dataType:"JSON",
    success: function(data) {
        if(data.status === 1){
            $('#main-body-leftpanel').html(data.details);
        } 
    }
}); 
return false;

});

I've added jquery.form.js and created form and using one input file tag and upon submitting it's only showing me temp path and not uploading file details..

It suppose to be uploading file as I ready done that but this time it's not working.

If anybody know how to upload file using Ajax please let me know

Thanks, Ali.

Ali Abdullah
  • 166
  • 8
  • Browsers have come a long way since the time that jquery.form.js was created. It is pretty much obsolete now. Is quite simple now using `FormData` API and `$.ajax`. See https://stackoverflow.com/questions/21044798/how-to-use-formdata-for-ajax-file-upload – charlietfl Nov 14 '18 at 20:56
  • Thanks for clarifying... – Ali Abdullah Nov 14 '18 at 21:56

0 Answers0