Answers for "how formdata work in ajax"

PHP
4

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
0

.ajax how to get data from form

$.ajax({
    ...
    data: $("#registerSubmit").serialize(),
    ...
})
Posted by: Guest on April-20-2022

Browse Popular Code Answers by Language