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.

2
  • 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 stackoverflow.com/questions/21044798/… Commented Nov 14, 2018 at 20:56
  • Thanks for clarifying... Commented Nov 14, 2018 at 21:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.