<form method="post" name="edit_user" id="edit_user" class="form card shadow-soft border p-4 mb-4" enctype="multipart/form-data">
<input type="hidden" name="edit_user_csrf" value="5d75f8e0bf6a69be29ad0c74afc287f4-1ef1497f20abd613328f725520e0361c">
<div class="row">
<div class="col-12">
<div class="form-group">
<div class="d-flex justify-content-between align-items-center mt-2">
<div class="custom-file">
<input type="file" name="profile_image" id="profile_image" class="custom-file-input">
<label class="custom-file-label" for="profile_image">Choose file</label>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="form-group">
<label for="last_name">First name *</label><input type="text" name="first_name" id="last_name" class="form-control" placeholder="First name">
<ul id="first_name_error" class="text-danger"></ul>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="form-group">
<label for="last_name">Last name *</label><input type="text" name="last_name" id="last_name" class="form-control" placeholder="Last name">
<ul id="last_name_error" class="text-danger"></ul>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group">
<label for="email_address">Email address *</label><input type="email" name="email_address" id="email_address" class="form-control" placeholder="Email address">
<ul id="email_address_error" class="text-danger"></ul>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group">
<input type="submit" name="update_profile" id="update_profile" class="btn btn-primary btn-dark mt-2" value="Update">
</div>
</div>
</div>
</form>
let form = document.querySelector('#edit_user');
let formData = new FormData(form);
for (var [key, value] of formData.entries()) {
console.log(key, value);
}
$.ajax({
url: url,
type: 'POST',
data: formData,
contentType: false,
cache: false,
processData: false
});