fix form new route
This commit is contained in:
SDE
2023-07-28 19:07:36 +03:00
parent 45234121d4
commit c0ed5d5803
4 changed files with 259 additions and 177 deletions

View File

@@ -42,10 +42,13 @@ function sendRoute(el){
//cleaning route inputs after selection changes
function OnSelectionChange(el) {
let form = el.form;
let formData = new FormData(form);
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
event.preventDefault()
let form = el.form;
let formData = new FormData(form);
$.ajax({
headers: {"X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val()},
url: '/ru/user_account/new_route_view/',
type: "POST",
// async: true,
@@ -54,24 +57,22 @@ function OnSelectionChange(el) {
contentType: false,
// enctype: 'json',
data: formData,
success: function(data){
// console.log('data received')
success: function (data) {
console.log('data.html');
// location.href = '/profile'
document.querySelector(".info_profile").innerHTML = data.html
$(document).ready(function (e){
$('#id_weight').ionRangeSlider({
skin: "round",
type: "single",
min: 0,
max: 1000,
from: 100,
step: 1,
grid: true,
grid_num: 5,
});
});
//
// $(document).ready(function (e){
// $('#id_weight').ionRangeSlider({
// skin: "round",
// type: "single",
// min: 0,
// max: 1000,
// from: 100,
// step: 1,
// grid: true,
// grid_num: 5,
// }
//get dynamic value
// let fromCountry = document.getElementById('id_from_country');