Created
August 11, 2021 11:40
-
-
Save shiv122/9075e1cd6b2f2b4aed3a13cded19aa9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#formId").submit(function(e) { | |
e.preventDefault(); | |
var form = $('#userData')[0]; | |
var formData = new FormData(form); | |
$.ajax({ | |
type: "POST", | |
url: "filepath/filename", | |
processData: false, | |
contentType: false, | |
data: formData, | |
success: function(response) { | |
console.log(response); | |
}, | |
error: function(response) { | |
console.log(response); | |
}, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment