Files
tripwithbonus/static/js/registration.js
2024-01-31 13:41:47 +03:00

27 lines
687 B
JavaScript

function SendRegistrationForm(el){
event.preventDefault()
let form = el.form;
let formData = new FormData(form);
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/user_account/registration/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: formData,
success: function(data){
location.href = `/profile/page/dashboard/`
},
error: function (data, exception){
document.querySelector(".register").innerHTML = data.responseJSON.html
}
});
}