Answers for "formdata ajax php"

PHP
1

formdata jquery ajax php

//set your ajax url here
//$url = 
$(document).on('submit', '#form',  function(e){
        e.preventDefault();
        $.ajax({
            type: 'POST',
            url: $url,
            data: new FormData(this),
            dataType: 'json',
            contentType: false,
            processData:false,//this is a must
            success: function(response){ 
                //statements on success
            }
        });
    });
Posted by: Guest on June-11-2021

Browse Popular Code Answers by Language