0.0.33 upd autocomlitev2.js
This commit is contained in:
@@ -1006,5 +1006,6 @@ form.new_route{
|
|||||||
.input_list.show{
|
.input_list.show{
|
||||||
display:block;
|
display:block;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
height: 200px;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,11 @@ function searchTown(el){
|
|||||||
let get_address_point = new Object({type_transport, search_str});
|
let get_address_point = new Object({type_transport, search_str});
|
||||||
get_address_point['ctrl_name'] = el.name;
|
get_address_point['ctrl_name'] = el.name;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
url: '/ru/reference_data/get_address_point/',
|
url: '/ru/reference_data/get_address_point/',
|
||||||
@@ -26,24 +31,34 @@ function searchTown(el){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function selectItemAddrPoint(id, name, ctrl_name){
|
function selectItemAddrPoint(id, name, ctrl_name){
|
||||||
|
//reset value
|
||||||
|
|
||||||
|
if (ctrl_name.startsWith("from")){
|
||||||
|
let fap_txt_cont = document.querySelector("#id_" + ctrl_name);
|
||||||
|
let fap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
|
||||||
|
fap_txt_cont.value = name;
|
||||||
|
fap_cont.value = id;
|
||||||
|
}
|
||||||
|
else if (ctrl_name.startsWith("to")) {
|
||||||
|
let tap_txt_cont = document.querySelector("#id_" + ctrl_name);
|
||||||
|
tap_txt_cont.value = name;
|
||||||
|
let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
|
||||||
|
tap_cont.value = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let fap_txt_cont = document.querySelector("#id_" + ctrl_name);
|
|
||||||
let fap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4));
|
|
||||||
fap_txt_cont.value = name;
|
|
||||||
fap_cont.value = id;
|
|
||||||
|
|
||||||
// // from_address_point
|
// // from_address_point
|
||||||
// let fap_txt_cont = document.querySelector("#id_from_address_point_txt");
|
// let fap_txt_cont = document.querySelector("#id_from_address_point_txt");
|
||||||
// let fap_cont = document.querySelector("#id_from_address_point");
|
// let fap_cont = document.querySelector("#id_from_address_point");
|
||||||
// fap_txt_cont.value = name;
|
// fap_txt_cont.value = name;
|
||||||
// fap_cont.value = id;
|
// fap_cont.value = id;
|
||||||
//
|
|
||||||
// //to_address_point
|
//to_address_point
|
||||||
// let tap_txt_cont = document.querySelector("#id_to_address_point_txt");
|
|
||||||
// let tap_cont = document.querySelector("#id_to_address_point");
|
|
||||||
//
|
|
||||||
// tap_txt_cont.value = name;
|
|
||||||
// tap_cont.value = id;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +71,7 @@ function insertSearchList(data, ctrl_name) {
|
|||||||
let divs = data.res_search_list;
|
let divs = data.res_search_list;
|
||||||
let input_list = document.getElementsByName(ctrl_name)[0];
|
let input_list = document.getElementsByName(ctrl_name)[0];
|
||||||
input_list.classList.add("show");
|
input_list.classList.add("show");
|
||||||
input_list.innerHTML = divs
|
input_list.innerHTML = divs;
|
||||||
//
|
//
|
||||||
// if (ac.value.length > 2) {
|
// if (ac.value.length > 2) {
|
||||||
// //
|
// //
|
||||||
|
|||||||
@@ -39,22 +39,22 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="from_to_country">
|
<div class="from_to_country">
|
||||||
<div>
|
<div>
|
||||||
<label for="id_from_address_point">{{ form.fields.from_address_point.label }}</label>
|
<label for="id_from_address_point">{{ form.fields.from_address_point.label }}</label>
|
||||||
<input type="number" name="from_address_point" id="id_from_address_point" hidden />
|
<input type="number" name="from_address_point" id="id_from_address_point" hidden />
|
||||||
<input oninput="searchTown(this)" type="text" name="from_address_point_txt"{% if form.fields.from_address_point.required %} required{% endif %} id="id_from_address_point_txt">
|
<input oninput="searchTown(this)" type="text" name="from_address_point_txt"{% if form.fields.from_address_point.required %} required{% endif %} id="id_from_address_point_txt">
|
||||||
<div class="input_list" name="from_address_point_txt_list">
|
<div class="input_list" name="from_address_point_txt_list">
|
||||||
{% include 'widgets/w_ac_input_address_point.html' %}
|
|
||||||
</div>
|
</div>
|
||||||
{% if form.errors and form.errors.from_address_point %}
|
{% if form.errors and form.errors.from_address_point %}
|
||||||
<span>{{ form.errors.from_address_point}}</span>
|
<span>{{ form.errors.from_address_point}}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="id_to_address_point">{{ form.fields.to_address_point.label }}</label>
|
<label for="id_to_address_point">{{ form.fields.to_address_point.label }}</label>
|
||||||
<input type="number" name="to_address_point" id="id_to_address_point" hidden />
|
<input type="number" name="to_address_point" id="id_to_address_point" hidden />
|
||||||
<input oninput="searchTown(this)" type="text" name="to_address_point_txt"{% if form.fields.to_address_point.required %} required{% endif %} id="id_to_address_point"/>
|
<input oninput="searchTown(this)" type="text" name="to_address_point_txt"{% if form.fields.to_address_point.required %} required{% endif %} id="id_to_address_point"/>
|
||||||
<div class="input_list" name="to_address_point_txt_list">
|
<div class="input_list" name="to_address_point_txt_list">
|
||||||
{% include 'widgets/w_ac_input_address_point.html' %}
|
|
||||||
</div>
|
</div>
|
||||||
{% if form.errors and form.errors.to_address_point %}
|
{% if form.errors and form.errors.to_address_point %}
|
||||||
<span>{{ form.errors.to_address_point }}</span>
|
<span>{{ form.errors.to_address_point }}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user