0.0.20 add autocomplete for search in input

This commit is contained in:
2023-07-19 15:50:00 +03:00
parent 113e576d4c
commit 7c320d2709
12 changed files with 300 additions and 14 deletions

28
static/js/sendRoute.js Normal file
View File

@@ -0,0 +1,28 @@
function sendRoute(el){
event.preventDefault()
let form = el.form;
let formData = new FormData(form);
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/routes/create_route/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: formData,
success: function(data){
console.log('data received')
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html
},
error: function (data, exception){
document.querySelector(".button_register").innerHTML = data.responseJSON.html
}
});
}